Symfony Variations is embed a set of many other variations, that’s advantageous to modify related organizations in a single form. In this post, you’ll do an application in order to modify a role group and you will, best into the same setting, you’ll edit, would and remove many Mark stuff linked to one to Task.
Just how to Embed some Versions
Second, let us carry out a questionnaire to do the job entity, having fun with a CollectionType world of TagType forms. This may allow us to tailor all Tag components of a job correct when you look at the activity means in itself:
If the associate submits the form, the newest filed research into labels community is utilized to build a keen ArrayCollection out-of Tag things. The newest collection will be seriously interested in the brand new level world of the latest Task and can end up being utilized through $task->getTags() .
Thus far, so it works great, however, simply to edit present tags. It will not have developed but really to include new tags or delete current ones.
You could potentially embed nested collections as many account off since you instance. Although not, by using Xdebug, you are able to found an optimum form nesting amount of ‘100’ attained, aborting! mistake. To fix that it, boost the xdebug.max_nesting_level PHP means, or render for every single means occupation yourself having fun with setting_row() in lieu of leaving the whole means at the same time (age.grams means_widget(form) ).
Enabling “new” Labels into the “Prototype”
However, earliest, you really need to allow function collection remember that in place of precisely a few, it does found an unknown number of tags. Or even, you will observe a “This type cannot contain additional areas” mistake. This is accomplished for the allow_include solution:
- in your template:
The design.tags.vars.prototype was a form feature that appears and you may seems identical to the person mode_widget(level.*) points within your getting cycle. This means that you can phone call mode_widget() , form_row() or means_label() involved. You could even love to give only one of its fields (age.g. title career):