Skip to content

Commit

Permalink
Merge pull request #420 from jockri/fix-extra-form-field-class
Browse files Browse the repository at this point in the history
[AdminBundle] When an extra css class was added in the FormType, the basic classes where removed
  • Loading branch information
kimausloos committed May 21, 2015
2 parents 280e974 + fe417a1 commit 868f811
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,16 @@
{% block form_widget_simple %}
{% spaceless %}
{% set type = type|default('text') %}
<input type="{{ type }}" {{ block('widget_attributes') }} {% if value is not empty %}value="{{ value }}"{% endif %} class="form-control{% if attr['maxlength'] is defined %} js-max-length-input{% endif %}">
{% set attr = attr|merge({ 'class': (attr.class|default('') ~ ' form-control' ~ (attr['maxlength'] is defined ? ' js-max-length-input' : ''))|trim }) %}
<input type="{{ type }}" {{ block('widget_attributes') }} {% if value is not empty %}value="{{ value }}"{% endif %}>
{% endspaceless %}
{% endblock form_widget_simple %}


{% block textarea_widget %}
{% spaceless %}
<textarea {{ block('widget_attributes') }} class="form-control{% if attr['maxlength'] is defined %} js-max-length-input{% endif %}" rows="5">{{ value }}</textarea>
{% set attr = attr|merge({ 'class': (attr.class|default('') ~ ' form-control' ~ (attr['maxlength'] is defined ? ' js-max-length-input' : ''))|trim }) %}
<textarea {{ block('widget_attributes') }} rows="5">{{ value }}</textarea>
{% endspaceless %}
{% endblock textarea_widget %}

Expand Down

0 comments on commit 868f811

Please sign in to comment.