Skip to content

Commit

Permalink
Add support for col_size and simple_col to textarea_widget
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Eckerstorfer committed Nov 24, 2013
1 parent f1a9215 commit 898b175
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Resources/views/Form/bootstrap.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,26 @@

{% block textarea_widget %}
{% spaceless %}
{% set col_size = col_size|default(bootstrap_get_col_size()) %}

{% if attr.simple_col is defined and attr.simple_col is not empty %}
{% set simple_col = attr.simple_col %}
{% endif %}
{% if attr.col_size is defined and attr.col_size is not empty %}
{% set col_size = attr.col_size %}
{% endif %}

{% if simple_col is defined %}
<div class="col-{{ col_size }}-{{ simple_col }}">
{% endif %}

{% set attr = attr|merge({ 'class': (attr.class|default('') ~ ' form-control')|trim }) %}

<textarea {{ block('widget_attributes') }}>{{ value }}</textarea>

{% if simple_col is defined %}
</div>
{% endif %}
{% endspaceless %}
{% endblock textarea_widget %}

Expand Down

0 comments on commit 898b175

Please sign in to comment.