Skip to content

Commit

Permalink
feature #3875 Added a note about customizing a form with more than on…
Browse files Browse the repository at this point in the history
…e template (javiereguiluz)

This PR was merged into the 2.3 branch.

Discussion
----------

Added a note about customizing a form with more than one template

| Q             | A
| ------------- | ---
| Doc fix?      | no
| New docs?     | yes
| Applies to    | 2.3+
| Fixed tickets | #3643

Commits
-------

ce14104 Fixed a minor grammar mistake
1b386ff Fixed a minor error
08d26ee Removed the old syntax and left just the "with" keyword syntax
94625c5 Fixed minor formatting issue
6621720 Minor formatting improvement
2b0213b Added a note about customizing a form with more than one template
  • Loading branch information
weaverryan committed Jul 11, 2014
2 parents a3fe74f + ce14104 commit eae9ad0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions cookbook/form/form_customization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,22 @@ When the ``form.age`` widget is rendered, Symfony will use the ``integer_widget`
block from the new template and the ``input`` tag will be wrapped in the
``div`` element specified in the customized block.

Multiple Templates
..................

A form can also be customized by applying several templates. To do this, pass the
name of all the templates as an array using the ``with`` keyword:

.. code-block:: html+jinja

{% 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.

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

Expand Down

0 comments on commit eae9ad0

Please sign in to comment.