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 2a5d9cb

Browse filesBrowse files
stephen-lewisfabpot
authored andcommitted
[TwigBridge] button_widget now has its title attr translated even if its label = null or false
1 parent 8e9aafc commit 2a5d9cb
Copy full SHA for 2a5d9cb

File tree

1 file changed

+2
-4
lines changed
Filter options

1 file changed

+2
-4
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,11 @@
222222
'%name%': name,
223223
'%id%': id,
224224
}) %}
225-
{%- elseif label is same as(false) -%}
226-
{% set translation_domain = false %}
227-
{%- else -%}
225+
{%- elseif label is not same as(false) -%}
228226
{% set label = name|humanize %}
229227
{%- endif -%}
230228
{%- endif -%}
231-
<button type="{{ type|default('button') }}" {{ block('button_attributes') }}>{{ translation_domain is same as(false) ? label : label|trans({}, translation_domain) }}</button>
229+
<button type="{{ type|default('button') }}" {{ block('button_attributes') }}>{{ translation_domain is same as(false) or label is same as(false) ? label : label|trans({}, translation_domain) }}</button>
232230
{%- endblock button_widget -%}
233231

234232
{%- block submit_widget -%}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.