{% extends 'form_div_layout.html.twig' %} {% block form_row -%}
{{- form_widget(form) -}} {{- form_label(form) -}} {{- form_help(form) -}} {{- form_errors(form) -}}
{%- endblock form_row %} {% block form_widget_simple %} {% if type is not defined or type not in ['file', 'hidden'] %} {%- set attr = attr|merge({class: (attr.class|default(''))|trim}) -%} {% endif %} {{- parent() -}} {% if tooltip is defined %} error {% endif %} {% endblock form_widget_simple %} {% block form_label -%} {%- set label_attr = label_attr|merge({class: (label_attr.class|default(''))|trim}) -%} {{- parent() -}} {%- endblock form_label %} {% block form_help -%} {%- set help_attr = help_attr|merge({class: (help_attr.class|default('helper-text'))|trim}) -%} {{- parent() -}} {%- endblock form_help %} {% block checkbox_row -%}
{{- form_widget(form) -}} {{- form_label(form) -}} {{- form_help(form) -}} {{- form_errors(form) -}}
{%- endblock checkbox_row %} {% block checkbox_widget -%} {%- endblock checkbox_widget %} {# Checkbox label is raw here #} {%- block checkbox_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}) %} {%- 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 -%} {{ translation_domain is same as(false) ? label|raw : label|trans({}, translation_domain)|raw }} {%- endif -%} {%- endblock -%} {% block button_widget -%} {% set attr = attr|merge({class: (attr.class|default('waves-effect waves-light') ~ ' btn')|trim}) %} {{- parent() -}} {%- endblock %} {%- 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 textarea_widget -%} {% set attr = attr|merge({class: (attr.class|default('') ~ 'materialize-textarea')|trim}) %} {{ parent() }} {%- endblock -%} {# ERRORS MGT #} {%- block form_errors -%} {%- if errors|length > 0 -%} {%- for error in errors -%} {%- endfor -%} {%- endif -%} {%- endblock form_errors -%} {%- block widget_attributes -%} {% if errors|length > 0 %} {% set _class = 'invalid' %} {% if attr.class is defined %} {% set _class = _class ~ ' ' ~ attr.class|trim %} {% endif %} {% set attr = attr|merge({'class': _class}) %} {% endif %} {{- parent() -}} {%- endblock widget_attributes -%} {# ERRORS MGT END #} {# FileType #} {% block file_widget -%} <{{ element|default('div') }} class="file-field input-field">
{{- form_errors(form) -}}
{%- endblock %}