{%- block choice_widget_collapsed -%} {%- if required and placeholder is none and not placeholder_in_choices and not multiple and (attr.size is not defined or attr.size <= 1) -%} {% set required = false %} {%- endif -%}
{%- endblock choice_widget_collapsed -%} {%- block form_label -%} {% if label is not same as(false) -%} {% if not compound -%} {% set label_attr = label_attr|merge({'for': id}) %} {%- endif -%} {% if required -%} {% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' required')|trim}) %} {% else %} {% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' optionnal')|trim}) %} {%- endif -%} {% if label is empty -%} {%- if label_format is not empty -%} {% set label = label_format|replace({ '%name%': name, '%id%': id, }) %} {%- else -%} {% set label = name|humanize %} {%- endif -%} {%- endif -%} <{{ element|default('label') }}{% if label_attr %}{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}{% endif %}> {%- if translation_domain is same as(false) -%} {%- if label_html is same as(false) -%} {{- label -}} {%- else -%} {{- label|raw -}} {%- endif -%} {%- else -%} {%- if label_html is same as(false) -%} {{- label|trans(label_translation_parameters, translation_domain) -}} {%- else -%} {{- label|trans(label_translation_parameters, translation_domain)|raw -}} {%- endif -%} {%- endif -%} {%- endif -%} {%- endblock form_label -%}