[TwigBridge] bootstrap4 file_widget: allow setting label attributes declared in label_attr
This commit is contained in:
parent
68439059d0
commit
9c76b29d14
@ -122,7 +122,8 @@
|
||||
<{{ element|default('div') }} class="custom-file">
|
||||
{%- set type = type|default('file') -%}
|
||||
{{- block('form_widget_simple') -}}
|
||||
<label for="{{ form.vars.id }}" class="custom-file-label">
|
||||
{%- set label_attr = label_attr|merge({ class: (label_attr.class|default('') ~ ' custom-file-label')|trim }) -%}
|
||||
<label for="{{ form.vars.id }}" {% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}>
|
||||
{%- if attr.placeholder is defined -%}
|
||||
{{- translation_domain is same as(false) ? attr.placeholder : attr.placeholder|trans({}, translation_domain) -}}
|
||||
{%- endif -%}
|
||||
|
Reference in New Issue
Block a user