1

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?

1 Answer 1

5

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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.