$ 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)
If you have found this video helpful, please consider sharing. I really appreciate it.
|1||Introduction to the Symfony Form Collection Field Type||06:47|
|2||Adding New Items To Our Collection||08:48|
|3||Removing Existing Items from a Symfony Form Collection||07:04|
|4||Persisting Additions to a Symfony Form Collection||09:40|
|5||Deleting Records from our Form Collection||11:37|