I would like to create a form which has multiple input fields corresponding to the elements of an array. In ASP.Net MVC 3 I had the ModelBuilder that encoded information about the underlying model inside the input HTML tags and rebuilt the model automatically on POST but I haven't managed to find something similar in Symfony2.
Could anyone tell me whether in Symfony2 there is a way of telling the FormBuilder that the field it receives by calling the add method is actually an array?
Add a comment
|
1 Answer
This can be done using the form 'Collection' field type. See the Symfony Cookbook entry on 'How to Embed a Collection of Forms'