{# Widgets #} {%- block form_widget -%} {% if compound %} {{- block('form_widget_compound') -}} {% else %} {{- block('form_widget_simple') -}} {% endif %} {%- endblock form_widget -%} {%- block form_widget_simple -%} {%- set type = type|default('text') -%} {%- endblock form_widget_simple -%} {%- block form_widget_compound -%} {%- if form.parent is empty -%} {{ form_errors(form) }} {%- endif -%} {{- block('form_rows') -}} {{- form_rest(form) -}} {%- endblock form_widget_compound -%} {%- block collection_widget -%} {% if prototype is defined %} {%- set attr = attr|merge({'data-prototype': form_row(prototype) }) -%} {% endif %} {{- block('form_widget') -}} {%- endblock collection_widget -%} {%- block textarea_widget -%} {%- endblock textarea_widget -%} {%- block choice_widget -%} {% if expanded %} {{- block('choice_widget_expanded') -}} {% else %} {{- block('choice_widget_collapsed') -}} {% endif %} {%- endblock choice_widget -%} {%- block choice_widget_expanded -%}