From 10df5d16c12ee8fc4bd6f76e34b831be982b0e5d Mon Sep 17 00:00:00 2001 From: Edvinas Klovas Date: Mon, 29 Dec 2014 15:20:11 +0200 Subject: [PATCH] Currently if you want to use inline bootstrap form rendering, this is usually enough: 1. Using bootstrap_3_layout.html.twig 2. Rendering form with `{{ form(form, { 'attr': {'class': 'form-inline'} }) }}` Form rendering breaks for buttons as the buttons are rendered in a separate
element without any attributes (this is coming from form_div_layout.html.twig which has this block hard-coded). The rest of the elements render with
which make them compatible with form-inline attribute in the form (`
`). The problem makes buttons render on new lines for inline forms. Extending button_row in bootstrap_3_layout.html.twig template fixes this. Signed-off-by: Edvinas Klovas --- .../Twig/Resources/views/Form/bootstrap_3_layout.html.twig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig index 0e4da9d0ee..e934305014 100644 --- a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig +++ b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig @@ -181,6 +181,12 @@
{%- endblock form_row %} +{% block button_row -%} +
+ {{- form_widget(form) -}} +
+{%- endblock button_row %} + {% block choice_row -%} {% set force_error = true %} {{ block('form_row') }}