@@ -336,45 +336,19 @@ template and then importing it inside your application configuration:
336
336
Any customized form blocks inside the ``AcmeDemoBundle:Form:fields.html.twig ``
337
337
template will be used globally when form elements are rendered.
338
338
339
- Use table-layout for the forms instead of divs
340
- ----------------------------------------------
341
-
342
339
Standard twig uses the div layout for forms, however some people prefer the table layout.
343
- Change you config.yml into this to make it system-wide:
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:
344
342
345
- .. configuration-block ::
343
+ `` AcmeDemoBundle:Form:fields.html.twig `` to `` TwigBundle:Form:table_layout.html.twig ``
346
344
347
- .. code-block :: yaml
348
-
349
- # app/config/config.yml
350
- twig :
351
- form :
352
- resources : ['TwigBundle:Form:table_layout.html.twig']
353
- # ...
354
-
355
- .. code-block :: xml
356
-
357
- <!-- app/config/config.xml -->
358
- <twig : config ...>
359
- <twig : form >
360
- <twig : resource >TwigBundle:Form:table_layout.html.twig</twig : resource >
361
- </twig : form >
362
- <!-- ... -->
363
- </twig : config >
364
-
365
- .. code-block :: php
366
-
367
- // app/config/config.php
368
- $container->loadFromExtension('twig', array(
369
- 'form' => array('resources' => array('TwigBundle:Form:table_layout.html.twig'))
370
- // ...
371
- ));
372
-
373
345
Or if you only want to use it so now and then, you can put it in your twig template like this:
374
346
375
347
.. code-block :: html+jinja
376
348
377
349
{% form_theme form 'TwigBundle:Form: table_layout.html.twig' %}
350
+
351
+ Keep in mind the ``form `` in the above code is the variable that contains the ``FormView `` instance here.
378
352
379
353
How to customize an Individual field
380
354
------------------------------------
0 commit comments