{% extends "bootstrap_4_layout.html.twig" %} {% block collection_widget %} {% set attr = attr|merge({ "class": attr.class|default("") ~ " collection", "data-allow-add": allow_add ? "true" : "false", "data-allow-delete": allow_delete ? "true" : "false", }) %} {% if prototype is defined %} {% set attr = attr|merge({"data-prototype": prototype_name is defined ? _self.build_prototype(prototype_name, prototype, true) : form_row(prototype) }) %} {% endif %}
{% for child in form %}
{{ prototype_name is defined ? _self.build_prototype(prototype_name, child, false) : form_row(child) }}
{% endfor %}
{% endblock collection_widget %} {% macro build_prototype(blockName, form, esc) %} {% set proto %} {{ block(blockName) }} {{ form_rest(form) }} {% endset %} {% if esc %}{{ proto|escape }}{% else %}{{ proto }}{% endif %} {% endmacro %}