[TYPO3-mvc] How to save IRRE Values?

Franz Koch typo3.RemoveForMessage at elements-net.de
Tue Apr 19 19:57:14 CEST 2011


Hey,

>> again it's important to use the same index for extbase to know which
>> properties belong to which object.
>
> even it is tempting to use the objects's uid as index as in
> product.store.{store.uid}.name this is not a good idea. could be you are
> redirected here because validation failed after creating new items and
> the newly created items don't have uids then. to avoid that i
> implemented the following in my model.
>
> /**
> * @return string
> */
> public function getHash() {
> return spl_object_hash($this);
> }
>
> and used {store.hash} as unique identifier in the form.

I don't think there is a need for this Felix - you're looping over the 
entries anyway, so you can simply use the iterator index as key (that's 
what I do)

<f:for each="{object.childObjects}" as="childObject" 
iterator="childIterator">
	<f:form.foo property="childObjects.{childIterator.index}.name" 
value="{childObject.name}" />
</f:for>

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list