Search code examples
formshtml-tablesymfony1customizationsemantics

Symfony 1.4 - are forms always in <table>?


I'm using sfDoctrineAllowPlugin. I need form which has Twitter's Bootstrap semantics. I looked into template and I found, that there is only $form, which is a <table>. How can I format it in my way? I don't want to use table, rows and cols.


Solution

  • There are plenty of render* functions available to display each item in your form.

    • renderRow
    • renderLabel
    • render
    • renderError
    • etc ...

    But you can also define a decorator (a custom sfWidgetFormSchemaFormatter) for your form to define the way each item will be display. Check this example of adding * for each required field.