Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9c76b29

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

File tree

1 file changed

+2
-1
lines changed
Filter options

1 file changed

+2
-1
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig
+2-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.