Skip to content

Improve the docs about custom form theme config #10126

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
Jul 30, 2018
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
8 changes: 8 additions & 0 deletions form/form_themes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ file:
# app/config/config.yml
twig:
form_themes:
- '...'
- 'form/fields.html.twig'
# ...

Expand All @@ -194,6 +195,7 @@ file:
http://symfony.com/schema/dic/twig http://symfony.com/schema/dic/twig/twig-1.0.xsd">

<twig:config>
<twig:theme>...</twig:theme>
<twig:theme>form/fields.html.twig</twig:theme>
<!-- ... -->
</twig:config>
Expand All @@ -204,11 +206,17 @@ file:
// app/config/config.php
$container->loadFromExtension('twig', array(
'form_themes' => array(
'...',
'form/fields.html.twig',
),
// ...
));

.. note::

Add your custom theme at the end of the ``form_themes`` list because each
theme overrides all the previous themes.

Any blocks inside the ``fields.html.twig`` template are now used globally
to define form output.

Expand Down