8000 [cookbook][forms] Tweaking twig form customization · adrienbrault/symfony-docs@83f9a7f · GitHub
[go: up one dir, main page]

Skip to content

Commit 83f9a7f

Browse files
committed
[cookbook][forms] Tweaking twig form customization
1 parent 3a35c70 commit 83f9a7f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

cookbook/form/twig_form_customization.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -336,19 +336,20 @@ template and then importing it inside your application configuration:
336336
Any customized form blocks inside the ``AcmeDemoBundle:Form:fields.html.twig``
337337
template will be used globally when form elements are rendered.
338338

339-
Standard twig uses the div layout for forms, however some people prefer the table layout.
340-
The technique to change to the table layout uses the same technique as it is listed above,
341-
however you will need to change:
339+
By default, twig uses a *div* layout when rendering forms. Some people, however,
340+
may prefer to render forms in a *table* layout. The technique to change to
341+
the table layout is the same as shown above, except you will need to change:
342342

343343
``AcmeDemoBundle:Form:fields.html.twig`` to ``TwigBundle:Form:table_layout.html.twig``
344344

345-
Or if you only want to use it so now and then, you can put it in your twig template like this:
345+
If you only want to make the change in one template, do the following:
346346

347347
.. code-block:: html+jinja
348348

349349
{% form_theme form 'TwigBundle:Form:table_layout.html.twig' %}
350350

351-
Keep in mind the ``form`` in the above code is the variable that contains the ``FormView`` instance here.
351+
Note that the ``form`` variable in the above code is the form view variable
352+
that you passed to your template.
352353

353354
How to customize an Individual field
354355
------------------------------------

0 commit comments

Comments
 (0)
0