wonzbak wonzbak - 3 months ago 16
Twig Question

Id attribute on form tag symfony

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

Have you tried attr?

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