Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 07a111e

Browse files
committed
Update src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig
Option for not displaying a label by setting label to false.
1 parent de958c7 commit 07a111e

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,13 @@
227227
{% if required %}
228228
{% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' required')|trim}) %}
229229
{% endif %}
230-
{% if label is empty %}
231-
{% set label = name|humanize %}
232-
{% endif %}
233-
<label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>{{ label|trans({}, translation_domain) }}</label>
234-
{% endspaceless %}
230+
{% if label is not sameas(false) %}
231+
{% if label is empty %}
232+
{% set label = name|humanize %}
233+
{% endif %}
234+
<label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>{{ label }}</label>
235+
{% endif %}
236+
{% endspaceless %}
235237
{% endblock form_label %}
236238

237239
{# Rows #}

0 commit comments

Comments
 (0)