8000 minor #49497 [TwigBridge] do not drop embed label classes (xabbuh) · symfony/symfony@1dcb0f9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1dcb0f9

Browse files
minor #49497 [TwigBridge] do not drop embed label classes (xabbuh)
This PR was merged into the 6.2 branch. Discussion ---------- [TwigBridge] do not drop embed label classes | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | #49421 (comment) | License | MIT | Doc PR | Commits ------- 7324eb8 do not drop embed label classes
2 parents 6bd3af0 + 7324eb8 commit 1dcb0f9

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