{% use "bootstrap_3_layout.html.twig" %}

{% block form_row -%}
	{% set showErrorIcon = (not compound or force_error|default(false)) and not valid %}
    <div class="form-group {% if (not compound or force_error|default(false)) and not valid %} has-error{% endif %} {{ showErrorIcon ? ' has-feedback' : '' }}">
        {{- form_label(form) -}}
        {{- form_widget(form) -}}
        {% if help|default %}
            <span class="help-block">{{ help }}</span>
        {% endif %}
        {{- form_errors(form) -}}
    </div>
{%- endblock form_row %}

{% block form_widget_simple -%}
	{% set showErrorIcon = false %}
    {% if type is not defined or type not in ['file', 'hidden'] %}
    	{# show error icon for these types #}
    	{% set showErrorIcon = (not compound or force_error|default(false)) and not valid %}
    {% endif %}
    {{- parent() -}}
    {% if showErrorIcon %}
        <span class="glyphicon glyphicon-remove form-control-feedback" aria-hidden="true"></span>
    {% endif %}
{%- endblock form_widget_simple %}
{% use "bootstrap_3_layout.html.twig" %}

{% block form_row -%}
	{% set showErrorIcon = (not compound or force_error|default(false)) and not valid %}
    
    <div class="form-group {% if (not compound or force_error|default(false)) and not valid %} has-error{% endif %} {{ showErrorIcon ? ' has-feedback' : '' }}">
        {{- form_label(form) -}}
        
        {% if help|default %}
            {# set the aria-describedby attribute #}
            {%- set attr = attr|merge({'aria-describedby': 'help-block-'~id }) -%}
        {% endif %}
        
        {{- form_widget(form, {
            'attr': attr
        }) -}}
        
        {% if help|default %}
            <span class="help-block" id="help-block-{{ id }}">{{ help }}</span>
        {% endif %}
        
        {{- form_errors(form) -}}
    </div>
{%- endblock form_row %}

{% block form_widget_simple -%}
	{% set showErrorIcon = false %}
    
    {% if type is not defined or type not in ['file', 'hidden'] %}
    	{# show error icon for these types #}
    	{% set showErrorIcon = (not compound or force_error|default(false)) and not valid %}
    {% endif %}
    
    {{- parent() -}}
    
    {% if showErrorIcon %}
        <span class="glyphicon glyphicon-remove form-control-feedback" aria-hidden="true"></span>
    {% endif %}
{%- endblock form_widget_simple %}
Add screen reader helper for forms
Add screen reader helper for forms
