10000 do not drop embed label classes · symfony/symfony@7324eb8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7324eb8

Browse files
committed
do not drop embed label classes
1 parent 0a9a264 commit 7324eb8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,10 @@
261261
{%- if required -%}
262262
{%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' required')|trim}) -%}
263263
{%- endif -%}
264+
{%- if parent_label_class is defined -%}
265+
{% set embed_label_classes = parent_label_class|split(' ')|filter(class => class in ['checkbox-inline', 'radio-inline']) %}
266+
{%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' ' ~ embed_label_classes|join(' '))|trim}) -%}
267+
{% endif %}
264268

265269
{{ widget|raw }}
266270
<label{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}>

0 commit comments

Comments
 (0)
0