Skip to content

Commit

Permalink
Currently if you want to use inline bootstrap form rendering, this is…
Browse files Browse the repository at this point in the history
… 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
<div> 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 <div class="form-group"> which make them compatible with
form-inline attribute in the form (`<form class="form-inline">`).

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 <edvinas@pnd.io>
  • Loading branch information
Edvinas Klovas committed Dec 29, 2014
1 parent 90378ab commit 10df5d1
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -181,6 +181,12 @@
</div>
{%- endblock form_row %}

{% block button_row -%}
<div class="form-group">
{{- form_widget(form) -}}
</div>
{%- endblock button_row %}

{% block choice_row -%}
{% set force_error = true %}
{{ block('form_row') }}
Expand Down

0 comments on commit 10df5d1

Please sign in to comment.