Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bb30765

Browse files
committed
bug #19222 [Form] Fix custom form type docs (aurimasrim)
This PR was merged into the 5.4 branch. Discussion ---------- [Form] Fix custom form type docs 1. Fixes the link to the twig config reference 2. Fixes the priority of order of `twig.form_themes` see https://symfony.com/doc/current/reference/configuration/twig.html#form-themes Commits ------- 4b645b4 Fix custom form type docs.
2 parents 0978b97 + 4b645b4 commit bb30765

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

form/create_custom_field_type.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,8 @@ fragments used to render the types:
362362
363363
{# ... here you will add the Twig code ... #}
364364
365-
Then, update the :ref:`form_themes option <reference-twig-tag-form-theme>` to
366-
add this new template at the beginning of the list (the first one overrides the
367-
rest of files):
365+
Then, update the :ref:`form_themes option <config-twig-form-themes>` to
366+
add this new template at the end of the list (each theme overrides all the previous ones):
368367

369368
.. configuration-block::
370369

@@ -373,8 +372,8 @@ rest of files):
373372
# config/packages/twig.yaml
374373
twig:
375374
form_themes:
376-
- 'form/custom_types.html.twig'
377375
- '...'
376+
- 'form/custom_types.html.twig'
378377
379378
.. code-block:: xml
380379
@@ -389,8 +388,8 @@ rest of files):
389388
https://symfony.com/schema/dic/twig/twig-1.0.xsd">
390389
391390
<twig:config>
392-
<twig:form-theme>form/custom_types.html.twig</twig:form-theme>
393391
<twig:form-theme>...</twig:form-theme>
392+
<twig:form-theme>form/custom_types.html.twig</twig:form-theme>
394393
</twig:config>
395394
</container>
396395
@@ -401,8 +400,8 @@ rest of files):
401400
402401
return static function (TwigConfig $twig) {
403402
$twig->formThemes([
404-
'form/custom_types.html.twig',
405403
'...',
404+
'form/custom_types.html.twig',
406405
]);
407406
};
408407

0 commit comments

Comments
 (0)