Skip to content

[Form] Fix custom form type docs #19222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions form/create_custom_field_type.rst
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,8 @@ fragments used to render the types:

{# ... here you will add the Twig code ... #}

Then, update the :ref:`form_themes option <reference-twig-tag-form-theme>` to
add this new template at the beginning of the list (the first one overrides the
rest of files):
Then, update the :ref:`form_themes option <config-twig-form-themes>` to
add this new template at the end of the list (each theme overrides all the previous ones):

.. configuration-block::

Expand All @@ -373,8 +372,8 @@ rest of files):
# config/packages/twig.yaml
twig:
form_themes:
- 'form/custom_types.html.twig'
- '...'
- 'form/custom_types.html.twig'

.. code-block:: xml

Expand All @@ -389,8 +388,8 @@ rest of files):
https://symfony.com/schema/dic/twig/twig-1.0.xsd">

<twig:config>
<twig:form-theme>form/custom_types.html.twig</twig:form-theme>
<twig:form-theme>...</twig:form-theme>
<twig:form-theme>form/custom_types.html.twig</twig:form-theme>
</twig:config>
</container>

Expand All @@ -401,8 +400,8 @@ rest of files):

return static function (TwigConfig $twig) {
$twig->formThemes([
'form/custom_types.html.twig',
'...',
'form/custom_types.html.twig',
]);
};

Expand Down