开发者

Forms in symfony

I am a begin开发者_StackOverflow中文版ner 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?


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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜