From 0c89701454913616a1331205f19c12736e7873eb Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 4 Oct 2017 10:47:28 +0200 Subject: [PATCH] Mention the new Bootstrap 4 form themes --- form/form_customization.rst | 14 ++++++++++++-- reference/configuration/twig.rst | 4 +++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/form/form_customization.rst b/form/form_customization.rst index 1ed087a32d6..bf7f7f21dc6 100644 --- a/form/form_customization.rst +++ b/form/form_customization.rst @@ -113,10 +113,17 @@ fragment needed to render every part of a form: * `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). +* `bootstrap_4_layout.html.twig`_, same as ``bootstrap_3_layout.html.twig``, but + updated for `Bootstrap 4 CSS framework`_ styles. +* `bootstrap_4_horizontal_layout.html.twig`_, same as ``bootstrap_3_horizontal_layout.html.twig`` + but updated for Bootstrap 4 styles. * `foundation_5_layout.html.twig`_, wraps each form field inside a ``
`` element with the appropriate CSS classes to apply the default `Foundation CSS framework`_ styles. +.. versionadded:: 3.4 + The Bootstrap 4 form themes were introduced in Symfony 3.4. + .. caution:: When you use the Bootstrap form themes and render the fields manually, @@ -211,7 +218,7 @@ this folder. In this example, the customized fragment name is ``integer_widget`` because you want to override the HTML ``widget`` for all ``integer`` field types. If you need to customize ``textarea`` fields, you would customize ``textarea_widget``. - + The ``integer`` part comes from the class name: ``IntegerType`` becomes ``integer``, based on a standard. @@ -1174,6 +1181,9 @@ more details about this concept in Twig, see :ref:`twig-reference-form-variables .. _`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/ +.. _`bootstrap_4_layout.html.twig`: https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig +.. _`bootstrap_4_horizontal_layout.html.twig`: https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_horizontal_layout.html.twig +.. _`Bootstrap 3 CSS framework`: https://getbootstrap.com/docs/3.3/ +.. _`Bootstrap 4 CSS framework`: https://getbootstrap.com/docs/4.0/ .. _`foundation_5_layout.html.twig`: https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Twig/Resources/views/Form/foundation_5_layout.html.twig .. _`Foundation CSS framework`: http://foundation.zurb.com/ diff --git a/reference/configuration/twig.rst b/reference/configuration/twig.rst index 5cd9f15b7be..526362f635c 100644 --- a/reference/configuration/twig.rst +++ b/reference/configuration/twig.rst @@ -20,6 +20,8 @@ TwigBundle Configuration ("twig") # Bootstrap: - bootstrap_3_layout.html.twig - bootstrap_3_horizontal_layout.html.twig + - bootstrap_4_layout.html.twig + - bootstrap_4_horizontal_layout.html.twig # Foundation - foundation_5_layout.html.twig @@ -91,7 +93,7 @@ TwigBundle Configuration ("twig") 3.14 - +