tags:

views:

16

answers:

1
+1  Q: 

Forms in symfony

I am a beginner with symfony, and I can not get my head around forms generation. In theory there even is a form framework, to have complete flexibility. But, as far as I understand, forms are rendered as tables in symfony. I am used to CakePHP where I can output input elements one at a time, and then wrap them as I wish: in tables, divs, whatever, or, more often than not, nothing, and just use CSS to position them correctly.

I am a bit appalled at the fact that a framework with such high standards on code quality then outputs HTML tables where they are not needed. I guess I'm just missing something.

Is there a way to output forms as forms, without extra HTML tags?

+3  A: 

A default formatter for sfForm::render() is sfWidgetFormSchemaFormatterTable. That's why your forms has been rendered as table when you used echo $form.

  1. A Gentle Introduction to symfony: Chapter 10 - Forms
  2. Practical symfony - Day 10: The Forms
  3. The More with symfony book: Advanced Forms
  4. sfForm::renderUsing()
  5. sfWidgetFormSchema::setDefaultFormFormatterName()
  6. Tones of other resources all over the Internet
Crozin