8000 Added a reference to the Bootstrap 3 form theme by javiereguiluz · Pull Request #4411 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Added a reference to the Bootstrap 3 form theme #4411

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
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
19 changes: 16 additions & 3 deletions cookbook/form/form_customization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,18 @@ rendering a form. In other words, if you want to customize one portion of
how a form is rendered, you'll import a *theme* which contains a customization
of the appropriate form fragments.

Symfony comes with a default theme (`form_div_layout.html.twig`_ in Twig and
``FrameworkBundle:Form`` in PHP) that defines each and every fragment needed
to render every part of a form.
Symfony comes with four **built-in form themes** that define each and every
fragment needed to render every part of a form:

* `form_div_layout.html.twig`_, wraps each form field inside a ``<div>`` element.
* `form_table_layout.html.twig`_, wraps the entire form inside a ``<table>``
element and each form field inside a ``<tr>`` element.
* `bootstrap_3_layout.html.twig`_, wraps each form field inside a ``<div>`` element
with the appropriate CSS classes to apply the default `Bootstrap 3 CSS framework`_
styles.
* `bootstrap_3_horizontal_layout.html.twig`_, it's similar to the previous theme,
but the CSS classes applied are the ones used to display the forms horizontally
(i.e. the label and the widget in the same row).

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

.. _`form_div_layout.html.twig`: https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig
.. _`form_table_layout.html.twig`: https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Twig/Resources/views/Form/form_table_layout.html.twig
.. _`bootstrap_3_layout.html.twig`: https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig
.. _`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
.. _`Bootstrap 3 CSS framework`: http://getbootstrap.com/
0