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:
341
341
342
342
.. code-block :: html+twig
343
343
344
+ {% extends 'base.html.twig' %}
345
+
344
346
{% form_theme form _self %}
345
347
346
348
{# this overrides the widget of any field of type integer, but only in the
@@ -359,12 +361,16 @@ for any overridden form blocks:
359
361
</div>
360
362
{% endblock %}
361
363
362
-
363
364
{# ... render the form ... #}
364
365
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.
368
374
369
375
Creating a Form Theme in a Separate Template
370
376
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can’t perform that action at this time.
0 commit comments