Since umpteens days, I block on a problem with Symfony 2 and forms.
I got a form of websites entities. \"Websites\" is a collection of website\'s entities and each w
A bit old, but here is a deadly simple solution.
The idea is simply to render the collection items through a Twig template, so you have full ability to customize the prototype that will be placed in your data-prototype="..."
tag. Just as if it was a normal, usual form.
In yourMainForm.html.twig:
And in MyBundle:MyViewsDirectory:prototype.html.twig:
{{ form_label(form.field1) }}
{{ form_widget(form.field1) }}
{{ form_label(form.field2) }}
{{ form_widget(form.field2) }}
Credit: adapted from https://gist.github.com/tobalgists/4032213