Adding New Items To Our Collection
$ sign for a start), but it gets the job done.
In our example, we only have one field - a
text field - called
name. As such, the prototype that Symfony creates for us in the
data-prototype section is quite small, even though it's full of escaped HTML messyness. In reality, these can get quite large.
To make it possible to add items we need to update our form field definition, specifying that
->add('speakers', 'collection', array( 'type' => new SpeakerType(), 'allow_add' => true, 'by_reference' => false, ))
(full code sample for the form is here)