File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -341,6 +341,8 @@ for any overridden form blocks:
341341
342342.. code-block :: html+twig
343343
344+ {% extends 'base.html.twig' %}
345+
344346 {% form_theme form _self %}
345347
346348 {# this overrides the widget of any field of type integer, but only in the
@@ -359,12 +361,16 @@ for any overridden form blocks:
359361 </div>
360362 {% endblock %}
361363
362-
363364 {# ... render the form ... #}
364365
365- The disadvantage of this method is that the customized form blocks can't be
366- reused when rendering other forms in other templates. If that's what you need,
367- create a form theme in a separate template as explained in the next section.
366+ The main disadvantage of this method is that it only works if your template
367+ extends another (``'base.html.twig' `` in the previous example). If your template
368+ does not, you must point ``form_theme `` to a separate template, as explained in
369+ the next section.
370+
371+ Another disadvantage is that the customized form blocks can't be reused when
372+ rendering other forms in other templates. If that's what you need, create a form
373+ theme in a separate template as explained in the next section.
368374
369375Creating a Form Theme in a Separate Template
370376~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can’t perform that action at this time.
0 commit comments