8000 Added a reference to the Bootstrap 3 form theme · symfony/symfony-docs@c85a8ac · GitHub
[go: up one dir, main page]

Skip to content
Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c85a8ac

Browse files
javiereguiluzweaverryan
authored andcommitted
Added a reference to the Bootstrap 3 form theme
1 parent f8226e2 commit c85a8ac

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

cookbook/form/form_customization.rst

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,18 @@ rendering a form. In other words, if you want to customize one portion of
9393
how a form is rendered, you'll import a *theme* which contains a customization
9494
of the appropriate form fragments.
9595

96-
Symfony comes with a default theme (`form_div_layout.html.twig`_ in Twig and
97-
``FrameworkBundle:Form`` in PHP) that defines each and every fragment needed
98-
to render every part of a form.
96+
Symfony comes with four **built-in form themes** that define each and every
97+
fragment needed to render every part of a form:
98+
99+
* `form_div_layout.html.twig`_, wraps each form field inside a ``<div>`` element.
100+
* `form_table_layout.html.twig`_, wraps the entire form inside a ``<table>``
101+
element and each form field inside a ``<tr>`` element.
102+
* `bootstrap_3_layout.html.twig`_, wraps each form field inside a ``<div>`` element
103+
with the appropriate CSS classes to apply the default `Bootstrap 3 CSS framework`_
104+
styles.
105+
* `bootstrap_3_horizontal_layout.html.twig`_, it's similar to the previous theme,
106+
but the CSS classes applied are the ones used to display the forms horizontally
107+
(i.e. the label and the widget in the same row).
99108

100109
In the next section you will learn how to customize a theme by overriding
101110
some or all of its fragments.
@@ -1059,3 +1068,7 @@ The array passed as the second argument contains form "variables". For
10591068
more details about this concept in Twig, see :ref:`twig-reference-form-variables`.
10601069

10611070
.. _`form_div_layout.html.twig`: https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig
1071+
.. _`form_table_layout.html.twig`: https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Twig/Resources/views/Form/form_table_layout.html.twig
1072+
.. _`bootstrap_3_layout.html.twig`: https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig
1073+
.. _`bootstrap_3_horizontal_layout.html.twig`: https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_horizontal_layout.html.twig
1074+
.. _`Bootstrap 3 CSS framework`: http://getbootstrap.com/

0 commit comments

Comments
 (0)
0