Symfony Versions can also be embed some a great many other models, that is advantageous to change related agencies in one means. In this article, you’ll would a type so you can revise a role category and you will, correct into the exact same mode, you’ll be able to modify, would and remove many Tag objects connected with one Activity.
How exactly to Embed a couple of Versions
Second, let’s manage a form to do the job organization, using good CollectionType world of TagType versions. This may allow us to personalize all of the Mark elements of a role proper in task setting in itself:
In the event that representative submits the form, the newest submitted investigation for the labels community is employed to construct an enthusiastic ArrayCollection out of Mark things. The newest collection is then seriously interested in this new mark arena of the latest Activity and will getting reached via $task->getTags() .
Up until now, that it is effective, but only to edit existing tags. It generally does not have developed but really to incorporate the fresh new labels otherwise remove existing ones.
You could embed nested stuff as numerous profile down as you such as for example. However, if you are using Xdebug, you can also located a maximum form nesting quantity of ‘100’ reached, aborting! mistake. To solve that it, help the xdebug.max_nesting_level PHP mode, otherwise provide for each and every means job manually playing with form_row() in lieu of rendering the entire function at a time (e.g mode_widget(form) ).
Allowing “new” Tags towards “Prototype”
However, basic, you really need to let the setting collection remember that unlike exactly several, it does located an unknown number of labels. If you don’t, you will observe good “This type cannot consist of additional sphere” mistake. This is done towards the allow_put option:
- in your template:
The proper execution.labels.vars.prototype is actually a questionnaire ability that appears and you can feels just like the person setting_widget(mark.*) issues in your having loop. Because of this you might telephone call form_widget() , form_row() or mode_label() with it. You can actually will provide one of the sphere (elizabeth.grams. the name career):