{% if type == 'new' %} {{ form_start(form, {'action': path('modal_new_category'), 'method':'POST', 'attr': {'class':'needs-validation'}}) }} {% else %} {{ form_start(form, {'action': path('modal_edit_category', {'id': category.id}), 'method':'POST', 'attr': {'class':'needs-validation'}}) }} {% endif %} {# Important: errors + rest doivent être avant form_end #} {{ form_errors(form) }} {{ form_rest(form) }} {{ form_end(form) }}