feature #24148 [Form] Hide label button when its setted to false (TeLiXj)

This PR was submitted for the 2.7 branch but it was merged into the 3.4 branch instead (closes #24148).

Discussion
----------

[Form] Hide label button when its setted to false

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | no
| Fixed tickets |
| License       | MIT
| Doc PR        |

Added same behaviour in buttons like in other form components when label is setted to false, don't show it.
It's very useful with buttons with icon and without text.

Commits
-------

e3190755cf Hide label button when its setted to false
This commit is contained in:
Fabien Potencier 2017-09-30 07:30:11 -07:00
commit 0c6eca34f6

View File

@ -216,7 +216,7 @@
{%- endblock range_widget %}
{%- block button_widget -%}
{%- if label is empty -%}
{%- if label is not same as(false) and label is empty -%}
{%- if label_format is not empty -%}
{% set label = label_format|replace({
'%name%': name,