Skip to content

Commit 8b96d6b

Browse files
Merge branch '4.2'
* 4.2: [Twig] Remove spaces to fix whitespace in tags [Twig] Replace for-loops with blocks for attributes fixed CS [Tests] Change to willThrowException [Console] fix PHPDoc in Command Update FileLoaderLoadException.php Fix wrong calls to clearstatcache Add Vietnamese translation for validators Allow running PHPUnit with "xdebug.scream" ON [VarDumper] Add descriptors tests [Cache] fix bad optim [Yaml] detect circular references [DI] fix reporting bindings on overriden services as unused [Routing] minor fix or previous PR
2 parents 0e24841 + 00d52cd commit 8b96d6b

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

Resources/views/Form/bootstrap_3_layout.html.twig

Lines changed: 2 additions & 3 deletions
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 -%}
@@ -178,8 +178,7 @@
178178
{% block form_help -%}
179179
{%- if help is not empty -%}
180180
{%- set help_attr = help_attr|merge({class: (help_attr.class|default('') ~ ' help-block')|trim}) -%}
181-
182-
<span id="{{ id }}_help" {% for attrname, attrvalue in help_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>
181+
<span id="{{ id }}_help"{% with { attr: help_attr } %}{{ block('attributes') }}{% endwith %}>
183182
{%- if translation_domain is same as(false) -%}
184183
{{- help -}}
185184
{%- else -%}

Resources/views/Form/bootstrap_4_layout.html.twig

Lines changed: 2 additions & 3 deletions
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>
@@ -303,8 +303,7 @@
303303
{% block form_help -%}
304304
{%- if help is not empty -%}
305305
{%- set help_attr = help_attr|merge({class: (help_attr.class|default('') ~ ' form-text text-muted')|trim}) -%}
306-
307-
<small id="{{ id }}_help" {% for attrname, attrvalue in help_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>
306+
<small id="{{ id }}_help"{% with { attr: help_attr } %}{{ block('attributes') }}{% endwith %}>
308307
{%- if translation_domain is same as(false) -%}
309308
{{- help -}}
310309
{%- else -%}

Resources/views/Form/form_div_layout.html.twig

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,7 @@
292292
{% block form_help -%}
293293
{%- if help is not empty -%}
294294
{%- set help_attr = help_attr|merge({class: (help_attr.class|default('') ~ ' help-text')|trim}) -%}
295-
296-
<p id="{{ id }}_help" {% for attrname, attrvalue in help_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>
295+
<p id="{{ id }}_help"{% with { attr: help_attr } %}{{ block('attributes') }}{% endwith %}>
297296
{%- if translation_domain is same as(false) -%}
298297
{{- help -}}
299298
{%- else -%}
@@ -352,7 +351,7 @@
352351
{%- else -%}
353352
{% set form_method = "POST" %}
354353
{%- endif -%}
355-
<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 %}>
354+
<form{% if name != '' %} name="{{ name }}"{% endif %} method="{{ form_method|lower }}"{% if action != '' %} action="{{ action }}"{% endif %}{{ block('attributes') }}{% if multipart %} enctype="multipart/form-data"{% endif %}>
356355
{%- if form_method != method -%}
357356
<input type="hidden" name="_method" value="{{ method }}" />
358357
{%- 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)