[TwigBridge] Fix bootstrap rendering when user explicitly use form_label
This commit is contained in:
parent
77cb48e1e2
commit
717c6d1800
@ -156,19 +156,22 @@
|
|||||||
{%- endblock radio_label %}
|
{%- endblock radio_label %}
|
||||||
|
|
||||||
{% block checkbox_radio_label %}
|
{% block checkbox_radio_label %}
|
||||||
{% if required %}
|
{# Do no display the label if widget is not defined in order to prevent double label rendering #}
|
||||||
{% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' required')|trim}) %}
|
{% if widget is defined %}
|
||||||
|
{% if required %}
|
||||||
|
{% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' required')|trim}) %}
|
||||||
|
{% endif %}
|
||||||
|
{% if parent_label_class is defined %}
|
||||||
|
{% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' ' ~ parent_label_class)|trim}) %}
|
||||||
|
{% endif %}
|
||||||
|
{% if label is empty %}
|
||||||
|
{% set label = name|humanize %}
|
||||||
|
{% endif %}
|
||||||
|
<label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>
|
||||||
|
{{ widget|raw }}
|
||||||
|
{{ label|trans({}, translation_domain) }}
|
||||||
|
</label>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if parent_label_class is defined %}
|
|
||||||
{% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' ' ~ parent_label_class)|trim}) %}
|
|
||||||
{% endif %}
|
|
||||||
{% if label is empty %}
|
|
||||||
{% set label = name|humanize %}
|
|
||||||
{% endif %}
|
|
||||||
<label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>
|
|
||||||
{{ widget|raw }}
|
|
||||||
{{ label|trans({}, translation_domain) }}
|
|
||||||
</label>
|
|
||||||
{% endblock checkbox_radio_label %}
|
{% endblock checkbox_radio_label %}
|
||||||
|
|
||||||
{# Rows #}
|
{# Rows #}
|
||||||
|
Reference in New Issue
Block a user