Skip to content

Commit f45db1f

Browse files
author
Jannik Zschiesche
committed
Add placeholder support in bootstrap 4 file fields
1 parent bcbe99f commit f45db1f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Resources/views/Form/bootstrap_4_layout.html.twig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,11 @@
119119
<{{ element|default('div') }} class="custom-file">
120120
{%- set type = type|default('file') -%}
121121
{{- block('form_widget_simple') -}}
122-
<label for="{{ form.vars.id }}" class="custom-file-label">Choose File</label>
122+
<label for="{{ form.vars.id }}" class="custom-file-label">
123+
{%- if attr.placeholder is defined -%}
124+
{{- translation_domain is same as(false) ? attr.placeholder : attr.placeholder|trans({}, translation_domain) -}}
125+
{%- endif -%}
126+
</label>
123127
</{{ element|default('div') }}>
124128
</div>
125129
{% endblock %}

0 commit comments

Comments
 (0)