File tree Expand file tree Collapse file tree 7 files changed +43
-9
lines changed Expand file tree Collapse file tree 7 files changed +43
-9
lines changed Original file line number Diff line number Diff line change @@ -23,10 +23,15 @@ col-sm-2
23
23
{# Rows #}
24
24
25
25
{% block form_row -%}
26
+ {%- set widget_attr = {} -%}
27
+ {%- if help is not empty -%}
28
+ {%- set widget_attr = {attr : {' aria-describedby' : id ~" _help" }} -%}
29
+ {%- endif -%}
26
30
<div class =" form-group{% if (not compound or force_error | default (false )) and not valid %} has-error{% endif %}" >
27
31
{{- form_label(form ) -}}
28
32
<div class =" {{ block (' form_group_class' ) }}" >
29
- {{- form_widget(form ) -}}
33
+ {{- form_widget(form , widget_attr ) -}}
34
+ {{- form_help(form ) -}}
30
35
{{- form_errors(form ) -}}
31
36
</div >
32
37
{# #} </div >
Original file line number Diff line number Diff line change 89
89
{# Rows #}
90
90
91
91
{% block form_row -%}
92
+ {%- set widget_attr = {} -%}
93
+ {%- if help is not empty -%}
94
+ {%- set widget_attr = {attr : {' aria-describedby' : id ~" _help" }} -%}
95
+ {%- endif -%}
92
96
<div class =" form-group{% if (not compound or force_error | default (false )) and not valid %} has-error{% endif %}" >
93
97
{{- form_label(form ) -}}
94
- {{- form_widget(form , { ' helpBlockDisplayed ' : true } ) -}}
98
+ {{- form_widget(form , widget_attr ) -}}
95
99
{{- form_help(form ) -}}
96
100
{{- form_errors(form ) -}}
97
101
</div >
Original file line number Diff line number Diff line change @@ -24,21 +24,31 @@ col-sm-2
24
24
{%- if expanded is defined and expanded -%}
25
25
{{ block (' fieldset_form_row' ) }}
26
26
{%- else -%}
27
+ {%- set widget_attr = {} -%}
28
+ {%- if help is not empty -%}
29
+ {%- set widget_attr = {attr : {' aria-describedby' : id ~" _help" }} -%}
30
+ {%- endif -%}
27
31
<div class =" form-group row{% if (not compound or force_error | default (false )) and not valid %} is-invalid{% endif %}" >
28
32
{{- form_label(form ) -}}
29
33
<div class =" {{ block (' form_group_class' ) }}" >
30
- {{- form_widget(form ) -}}
34
+ {{- form_widget(form , widget_attr ) -}}
35
+ {{- form_help(form ) -}}
31
36
</div >
32
37
{# #} </div >
33
38
{%- endif -%}
34
39
{%- endblock form_row %}
35
40
36
41
{% block fieldset_form_row -%}
42
+ {%- set widget_attr = {} -%}
43
+ {%- if help is not empty -%}
44
+ {%- set widget_attr = {attr : {' aria-describedby' : id ~" _help" }} -%}
45
+ {%- endif -%}
37
46
<fieldset class =" form-group" >
38
47
<div class =" row{% if (not compound or force_error | default (false )) and not valid %} is-invalid{% endif %}" >
39
48
{{- form_label(form ) -}}
40
49
<div class =" {{ block (' form_group_class' ) }}" >
41
- {{- form_widget(form ) -}}
50
+ {{- form_widget(form , widget_attr ) -}}
51
+ {{- form_help(form ) -}}
42
52
</div >
43
53
</div >
44
54
{# #} </fieldset >
Original file line number Diff line number Diff line change 257
257
{%- if compound is defined and compound -%}
258
258
{%- set element = ' fieldset' -%}
259
259
{%- endif -%}
260
+ {%- set widget_attr = {} -%}
261
+ {%- if help is not empty -%}
262
+ {%- set widget_attr = {attr : {' aria-describedby' : id ~" _help" }} -%}
263
+ {%- endif -%}
260
264
< {{ element | default (' div' ) }} class="form-group">
261
265
{{- form_label(form ) -}}
262
- {{- form_widget(form , { ' helpBlockDisplayed ' : true } ) -}}
266
+ {{- form_widget(form , widget_attr ) -}}
263
267
{{- form_help(form ) -}}
264
268
< /{{ element | default (' div' ) }}>
265
269
{%- endblock form_row %}
Original file line number Diff line number Diff line change 306
306
{%- endblock repeated_row -%}
307
307
308
308
{%- block form_row -%}
309
+ {%- set widget_attr = {} -%}
310
+ {%- if help is not empty -%}
311
+ {%- set widget_attr = {attr : {' aria-describedby' : id ~" _help" }} -%}
312
+ {%- endif -%}
309
313
<div >
310
314
{{- form_label(form ) -}}
311
315
{{- form_errors(form ) -}}
312
- {{- form_widget(form , { ' helpBlockDisplayed ' : true } ) -}}
316
+ {{- form_widget(form , widget_attr ) -}}
313
317
{{- form_help(form ) -}}
314
318
</div >
315
319
{%- endblock form_row -%}
397
401
id="{{ id }}" name="{{ full_name }}"
398
402
{%- if disabled %} disabled="disabled"{% endif -%}
399
403
{%- if required %} required="required"{% endif -%}
400
- {%- if helpBlockDisplayed is defined and helpBlockDisplayed is same as (true ) and help is not empty %} aria-describedby="{{ id }}_help"{% endif -%}
401
404
{{ block (' attributes' ) }}
402
405
{%- endblock widget_attributes -%}
403
406
Original file line number Diff line number Diff line change 1
1
{% use " form_div_layout.html.twig" %}
2
2
3
3
{%- block form_row -%}
4
+ {%- set widget_attr = {} -%}
5
+ {%- if help is not empty -%}
6
+ {%- set widget_attr = {attr : {' aria-describedby' : id ~" _help" }} -%}
7
+ {%- endif -%}
4
8
<tr >
5
9
<td >
6
10
{{- form_label(form ) -}}
7
11
</td >
8
12
<td >
9
13
{{- form_errors(form ) -}}
10
- {{- form_widget(form , { ' helpBlockDisplayed ' : true } ) -}}
14
+ {{- form_widget(form , widget_attr ) -}}
11
15
{{- form_help(form ) -}}
12
16
</td >
13
17
</tr >
Original file line number Diff line number Diff line change 267
267
{# Rows #}
268
268
269
269
{% block form_row -%}
270
+ {%- set widget_attr = {} -%}
271
+ {%- if help is not empty -%}
272
+ {%- set widget_attr = {attr : {' aria-describedby' : id ~" _help" }} -%}
273
+ {%- endif -%}
270
274
<div class =" row" >
271
275
<div class =" large-12 columns{% if (not compound or force_error | default (false )) and not valid %} error{% endif %}" >
272
276
{{ form_label(form ) }}
273
- {{- form_widget(form , { ' helpBlockDisplayed ' : true } ) -}}
277
+ {{- form_widget(form , widget_attr ) -}}
274
278
{{ form_help(form ) }}
275
279
{{ form_errors(form ) }}
276
280
</div >
You can’t perform that action at this time.
0 commit comments