Learn Symfony2 - Adding To A Form Collection [2 of 5]

preview_player
Показать описание
In the first part of the tutorial series we looked at how the bundle is set up, and what a Form Collection really is.

Now we move on to how to add things to your shiny new form collection. We cover the javascript involved and what it's up too behind the scenes, and we look at the output of our addition when submitting the form.
Рекомендации по теме
Комментарии
Автор

Followed this and the Symfony2 site, but for some reason the 'Add a speaker' option is not appearing in my form. When I do a page info check on the js file Chrome is throwing a Uncaught ReferenceError: $ is not defined for the first 2 variables for var $addSpeakerLink and var $newLinkLi.  

jackjones
Автор

Figured it out, I didn't have jquery loaded. Doh! :)

jackjones
Автор

Hey Chris - i know now how to add / remove collections. But how is this working, when i'm dealing with a collection within a collection, like:
> address (country name)
   > city
   > city
   > city ..
...

That i'd be able to add addresses ( which is working now) and in addition, add to each address type again a collection of cities. I've posted this on stackoverflow, because i couldn't find anything to that on the internet. I would really appreciate it, if you could have a look on that :-) 


Regards.

pgful