[FLOW3-general] Creating objects with collections
Julian Kleinhans
julian.kleinhans at aijko.de
Mon Jan 23 16:17:06 CET 2012
Hi,
i have a simliar problem. I would save a image collection but i dont
know what is here the best way to do this.
Can i see your initializeCreateAction please ?
regards
julian
Am 31.12.11 08:35, schrieb Pankaj Lele:
> Hello
>
> I was looking for a best approach to create a new object along with its
> property having a collection.
>
> E.g. Post has property tags of type
> \Doctrine\Common\Collection\ArrayCollection<\My\Package\Domain\Model\Tag>
>
> When creating a post with a Fluid form what to do about posting multiple
> tags?
>
> <f:form.textfield property="tags.0.name" />
> <f:form.textfield property="tags.1.name" />
>
> This does not work even if the object creation for properties is activated.
>
> For now to get this working we have to do in Fluid:
>
> <f:form.textfield name="tags[0]name" />
> <f:form.textfield name="tags[1]name" />
>
> And in the PostController->initializeCreateAction() get the tags raw
> argument and convert them to objects using propertyMapper and pass on
> array of objects to createAction($post, $tags).
>
> Is this good approach or is there any other way which me might not be
> knowing?
>
> Thanks in advance!
>
More information about the FLOW3-general
mailing list