From 36e455680549bfe9fa5b1282e95bb9b36f2220be Mon Sep 17 00:00:00 2001 From: BenjaminBeck Date: Mon, 3 Sep 2012 12:17:03 +0300 Subject: [PATCH] [Form] Option for not displaying a label by setting label to false. [Form] Fixed formatting & translation .. --- .../Twig/Resources/views/Form/form_div_layout.html.twig | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig index 0e562e4142..840fdcda99 100644 --- a/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig +++ b/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig @@ -227,10 +227,12 @@ {% if required %} {% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' required')|trim}) %} {% endif %} - {% if label is empty %} - {% set label = name|humanize %} + {% if label is not sameas(false) %} + {% if label is empty %} + {% set label = name|humanize %} + {% endif %} + {{ label|trans({}, translation_domain) }} {% endif %} - {{ label|trans({}, translation_domain) }} {% endspaceless %} {% endblock form_label %}