Skip to content

Commit 4712fc7

Browse files
Merge branch '3.4' into 4.1
* 3.4: [Twig] Replace for-loops with blocks for attributes [DI] fix reporting bindings on overriden services as unused
2 parents f4ed22f + 0698c5d commit 4712fc7

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

Resources/views/Form/bootstrap_3_layout.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
{% set label = name|humanize %}
9999
{%- endif -%}
100100
{%- endif -%}
101-
<label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>
101+
<label{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}>
102102
{{- widget|raw }} {{ label is not same as(false) ? (translation_domain is same as(false) ? label : label|trans({}, translation_domain)) -}}
103103
</label>
104104
{%- endif -%}

Resources/views/Form/bootstrap_4_layout.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@
260260
{%- endif -%}
261261

262262
{{ widget|raw }}
263-
<label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>
263+
<label{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}>
264264
{{- label is not same as(false) ? (translation_domain is same as(false) ? label : label|trans({}, translation_domain)) -}}
265265
{{- form_errors(form) -}}
266266
</label>

Resources/views/Form/form_div_layout.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@
350350
{%- else -%}
351351
{% set form_method = "POST" %}
352352
{%- endif -%}
353-
<form{% if name != '' %} name="{{ name }}"{% endif %} method="{{ form_method|lower }}"{% if action != '' %} action="{{ action }}"{% endif %}{% for attrname, attrvalue in attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}{% if multipart %} enctype="multipart/form-data"{% endif %}>
353+
<form{% if name != '' %} name="{{ name }}"{% endif %} method="{{ form_method|lower }}"{% if action != '' %} action="{{ action }}"{% endif %}{{ block('attributes') }}{% if multipart %} enctype="multipart/form-data"{% endif %}>
354354
{%- if form_method != method -%}
355355
<input type="hidden" name="_method" value="{{ method }}" />
356356
{%- endif -%}

Resources/views/Form/foundation_5_layout.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@
258258
{% set label = name|humanize %}
259259
{%- endif -%}
260260
{% endif %}
261-
<label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>
261+
<label{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}>
262262
{{ widget|raw }}
263263
{{ translation_domain is same as(false) ? label : label|trans({}, translation_domain) }}
264264
</label>

0 commit comments

Comments
 (0)