Symfony Forms can be implant some a number of other models, that is beneficial to change associated organizations in one form. In this post, you’ll be able to carry out an application so you’re able to revise a task class and you will, right within the exact same mode, you are able to modify, manage and take off many Mark objects connected with you to definitely Activity.
How-to Implant a set of Versions
Second, why don’t we create an application to do the job organization, using an excellent CollectionType realm of TagType models. This can allow us to tailor most of the Tag parts of a job proper for the activity setting itself:
When the affiliate submits the proper execution, the latest submitted research toward tags field can be used to create an ArrayCollection off Tag objects. Brand new range is then seriously interested in brand new mark arena of the brand new Activity and will end up being accessed via $task->getTags() .
At this point, it works great, however, only to modify existing labels. It will not have developed yet to incorporate the latest tags or delete established of them.
You could implant nested selections as much account off since you particularly. not, by using Xdebug, you’ll be able to discover a max means nesting quantity of ‘100’ hit, aborting! error. To resolve so it, help the xdebug.max_nesting_height PHP function, or render for each and every setting field yourself having fun with form_row() instead of helping to make the whole mode immediately (elizabeth.grams function_widget(form) ).
Enabling “new” Labels into the “Prototype”
However, earliest, you need to allow the setting range know that unlike just two, it does found a phone number from tags. Otherwise, you will notice a beneficial “This type ought not to include extra sphere” error. This is accomplished toward create_add alternative:
- in your template:
The form.tags.vars.model was a questionnaire element that appears and you will seems same as anyone function_widget(mark.*) facets within your getting circle. Because of this you might call means_widget() , form_row() or mode_label() involved. You might also desire render one of the industries (age.grams. the name industry):