Reputation: 228
Is it possible to add a class in the div container when there's an error in that field? For example adding class has-error to the class attribute of the div container
{% block field_row %}
<div class="form_row has-error">
{{ form_label(form) }}
{{ form_errors(form) }}
{{ form_widget(form) }}
</div>
{% endblock field_row %}
Upvotes: 1
Views: 102
Reputation: 52493
{% block field_row %}
<div class="form_row{% if form_errors(form) %} has-error{% endif %}">
{{ form_label(form) }}
{{ form_errors(form) }}
{{ form_widget(form) }}
</div>
{% endblock field_row %}
Upvotes: 1