Skip to content

Commit 9c76b29

Browse files
AngelFQCfabpot
authored andcommitted
[TwigBridge] bootstrap4 file_widget: allow setting label attributes declared in label_attr
1 parent 6843905 commit 9c76b29

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@
122122
<{{ element|default('div') }} class="custom-file">
123123
{%- set type = type|default('file') -%}
124124
{{- block('form_widget_simple') -}}
125-
<label for="{{ form.vars.id }}" class="custom-file-label">
125+
{%- set label_attr = label_attr|merge({ class: (label_attr.class|default('') ~ ' custom-file-label')|trim }) -%}
126+
<label for="{{ form.vars.id }}" {% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}>
126127
{%- if attr.placeholder is defined -%}
127128
{{- translation_domain is same as(false) ? attr.placeholder : attr.placeholder|trans({}, translation_domain) -}}
128129
{%- endif -%}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy