{% extends '@PimUI/Form/pim-fields.html.twig' %} {% block form_row_field %}
{{ form_label(form, '', { label_attr: label_attr|merge({ class: 'InputLabel' })}) }}
{{- form_widget(form) -}}
{{- form_errors(form) -}}
{% endblock %} {%- block form_widget_simple -%} {%- set type = type|default('text') -%} {% set class = attr.class ?? '' %} {% if type == 'text' or type == 'password' %} {% set class = 'InputText' %} {% endif %} {% if errors|length > 0 %} {% set class = class ~ ' ' ~ 'error' %} {% endif %} {% set attr = attr|merge({'class': class }) %} {%- endblock form_widget_simple -%} {% block form_label %} {% apply spaceless %} {% if label is not same as(false) %} {% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' AknFieldContainer-label')|trim}) %} {% if not compound %} {% set label_attr = label_attr|merge({'for': id}) %} {% endif %} {% if required %} {% set label_attr = label_attr|merge({'class': (label_attr.class ~ ' required')|trim}) %} {% endif %} {% if label is empty %} {% set label = name|humanize %} {% endif %} {% set isRadioLabel = form.parent.vars.expanded|default(false) and checked is defined %} {% set label = label|trans({}, translation_domain) %} {% if label_attr.truncate is defined and label_attr.truncate %} {% set label_attr = { 'title': label }|merge(label_attr) %} {% set label_attr = label_attr|merge({ 'class': (label_attr.class is defined ? label_attr.class ~ ' ' : '') ~ 'truncate' }) %} {% endif %} {% endif %} {% endapply %} {% endblock form_label %} {%- block form_errors -%} {%- if errors|length > 0 -%} {%- for error in errors -%}
{{ error.message }}
{%- endfor -%} {%- endif -%} {%- endblock form_errors -%}