]> Raphaël G. Git Repositories - airbundle/commitdiff
Add form global errors in a header block
authorRaphaël Gertz <git@rapsys.eu>
Wed, 11 Dec 2019 04:30:58 +0000 (05:30 +0100)
committerRaphaël Gertz <git@rapsys.eu>
Wed, 11 Dec 2019 04:30:58 +0000 (05:30 +0100)
Resources/views/form/form_div_layout.html.twig

index 7f73c516294d084f4e281bd683894f7e40c49948..dfc79b3eb5494c83c801b2145eabcf186ff2f456 100644 (file)
     {%- if form_method != method -%}
         <input type="hidden" name="_method" value="{{ method }}" />
     {%- endif -%}
     {%- if form_method != method -%}
         <input type="hidden" name="_method" value="{{ method }}" />
     {%- endif -%}
+    {%- if errors|length > 0 -%}
+        <header>
+            <div class="error">
+                {{- form_errors(form) -}}
+            </div>
+        </header>
+    {%- endif -%}
 {%- endblock form_start -%}
 
 {%- block form_end -%}
 {%- endblock form_start -%}
 
 {%- block form_end -%}