Id attribute on form tag symfony

wonzbak picture wonzbak · Sep 5, 2013 · Viewed 64.6k times · Source

I would like to define a id attribute on my symfony2 forms.

I've tried with this in my twig template:

{{ form_start(form, {'id': 'form_person_edit'}) }}

But it seems not working.

Answer

SirDerpington picture SirDerpington · Sep 5, 2013

Have you tried attr?

{{ form_start(form, {'attr': {'id': 'form_person_edit'}}) }}