Closed
Description
Description
For some app I need to customize each item inside a CollectionType form field. We have {% block collection_row %}
, {% block collection_widget %}
, etc. But we don't have a {% block collection_entry %}
and {% block collection_entry_row %}
, {% block collection_entry_widget %}
, etc.
At the end I needed to do this. It works, but it looks fragile:
{% block form_row %}
{# ... #}
{% set is_collection_item = block_prefixes|last ends with '_entry' %}
{% if is_collection_item %}
<div class="property-collection-item">
{{ form_widget(form) }}
</div>
{% else %}
{{ form_widget(form) }}
{% endif %}
{% endblock %}
So, should we add support for these collection_entry_*
blocks?
Thanks!