{% use "bootstrap_5_layout.html.twig" %} {% block form_row -%} {%- if compound is defined and compound -%} {%- set element = 'fieldset' -%} {%- endif -%} {%- set widget_attr = {} -%} {%- if help is not empty -%} {%- set widget_attr = {attr: {'aria-describedby': id ~"_help"}} -%} {%- endif -%} <{{ element|default('div') }} class="form-group"> {{- form_label(form) -}} {{- form_widget(form) -}} {{- form_help(form) -}} {{ element|default('div') }}> {%- endblock form_row %} {% block form_label -%} {% if label is not same as(false) -%} {%- if compound is defined and compound -%} {%- set element = 'legend' -%} {%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' col-form-label')|trim}) -%} {%- else -%} {%- set label_attr = label_attr|merge({for: id, class: (label_attr.class|default('') ~ ' form-label')|trim}) -%} {%- endif -%} {% if required -%} {% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' required')|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 -%} {% if translation_domain is not same as (false) %} {% set label = label|trans({}, translation_domain) %} {% endif %} <{{ element|default('label') }}{% if label_attr %}{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}{% endif %}>{{ label|raw|parse_icons }}{{- form_errors(form) -}}{{ element|default('label') }}> {%- endif -%} {%- endblock form_label %} {#{% block form_widget_simple %} {% apply spaceless %} {% set style = style|default('') %} {% set col_size = col_size|default(12) %} {% if attr.simple_col is defined and attr.simple_col is not empty %} {% set simple_col = attr.simple_col %} {% endif %} {% if attr.col_size is defined and attr.col_size is not empty %} {% set col_size = attr.col_size %} {% endif %} {% if attr.style is defined and attr.style is not empty %} {% set style = attr.style %} {% endif %} {% if simple_col is defined and simple_col %}
{{ value }}
{%- else -%} {% set attr = attr|merge({ 'class': (attr.class|default('') ~ ' mb-3')|trim }) %} {%- endif %} {% if simple_col is defined %}{{ 'role.full'|trans }} | |
---|---|
|