8000 Added a note about customizing a form with more than one template by javiereguiluz · Pull Request #3875 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Added a note about customizing a fo 8000 rm with more than one template #3875

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 6 commits into from
Jul 11, 2014
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Removed the old syntax and left just the "with" keyword syntax
  • Loading branch information
javiereguiluz committed Jun 10, 2014
commit 08d26ee18f856ccbf0f22846c418a24b5c0da804
17 changes: 3 additions & 14 deletions cookbook/form/form_customization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -302,29 +302,18 @@ Multiple Templates
..................

A form can also be customized applying several templates. To do so, pass the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... form can also be customized by applying several templates. To do this, pass

name of all the templates to the ``form_theme`` tag separating them with one
whitespace:
name of all the templates as an array using the ``with`` keyword:

.. code-block:: html+jinja

{% form_theme form '::common.html.twig' ':Form:fields.html.twig'
'AcmeDemoBundle:Form:fields.html.twig' %}
{% form_theme form with ['::common.html.twig', ':Form:fields.html.twig',
'AcmeDemoBundle:Form:fields.html.twig'] %}

{# ... #}

The templates can be located at different bundles and they can even be stored
at the global ``app/Resources/views/`` directory.

When using the ``with`` keyword, pass the templates as an array:


.. code-block:: html+jinja

{% form_theme form with ['::common.html.twig', ':Form:fields.html.twig',
'AcmeDemoBundle:Form:fields.html.twig'] %}

{# ... #}

Child Forms
...........

Expand Down
0