[Form] Option for not displaying a label by setting label to false.

[Form] Fixed formatting & translation ..
This commit is contained in:
BenjaminBeck 2012-09-03 12:17:03 +03:00 committed by Joseph Bielawski
parent 1ec59f174e
commit 36e4556805

View File

@ -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{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>{{ label|trans({}, translation_domain) }}</label>
{% endif %}
<label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>{{ label|trans({}, translation_domain) }}</label>
{% endspaceless %}
{% endblock form_label %}