Question

After hours of searching, I found a solution how to apply themes to individual fields for collection types here: symfony2: Applying theme to individual field for collection type (thanks @TroodoN-Mike).

So a custom theme for a collection type could be:

{% block _author_tags_entry_label %}
    {# ... #}
{% endblock %}

The word "entry" replaces the row index, which works fine, but I need the Row index inside the custom block, something like {{ entry }}. Any hints?

Thanks Chris

Was it helpful?

Solution

Ok, I found the solution. I wasn't aware of the fact, that you can pass custom variables to the form theme like this:

{{ form_row(form.field, {'customVariable': 'anyValue'}) }}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top