Symfony Forms can also be implant a couple of many other forms, that is beneficial to change relevant entities in one form. In this article, you’ll perform an application in order to modify a task group and you will, right inside the exact same mode, you’ll change, carry out and take off of numerous Mark items related to one to Activity.
Just how to Embed a set of Versions
2nd, let us would a type to do the job entity, playing with a beneficial CollectionType world of TagType versions. This can allow us to personalize all Tag parts of a job correct when you look at the task means alone:
When the affiliate submits the proper execution, the newest recorded studies for the tags occupation is utilized to construct a keen ArrayCollection away from Tag items. The new range will be set on the tag arena of the new Activity and can feel utilized through $task->getTags() .
So far, so it works great, but just to revise existing tags. It doesn’t have developed but really to incorporate new labels otherwise erase present of these.
You can embed nested series as many profile off since you such. But not, by using Xdebug, you may found a max mode nesting quantity of ‘100’ hit, aborting! error. To fix it, improve the xdebug.max_nesting_level PHP setting, or render for every single setting community by hand playing with form_row() in place of leaving the complete function at a time (age.grams means_widget(form) ).
Making it possible for “new” Labels with the “Prototype”
However, first, you will want to allow the function range remember that as opposed to precisely a few, it can discovered a phone number of tags. If you don’t, you will see a “This type must not consist of additional areas” mistake. This is accomplished to the enable it to be_create solution:
- in your template:
The shape.labels.vars.model is actually a type element that appears and you can seems same as the person function_widget(level.*) facets within your to possess loop. Consequently you might call mode_widget() , form_row() or function_label() in it. You can actually choose bring only 1 of the sphere (elizabeth.g. the name profession):