[TYPO3-mvc] passing on demand object to various views/formats
Thomas Allmer
at at delusionworld.com
Fri Mar 4 02:32:42 CET 2011
On 02.03.2011 10:31, Nikolas Hagelstein wrote:
> 1. Don't pass arroud the whole demand object. This is not possible
> trough links due to hmac issues (even if you disable it).
>
> 2. Insteand pass arround an "overwrite" deman array which consists of
> key/properties you whish to manipulate.
>[...]
>
> Hope this helps,
yeah this definitely helped a lot...
it all works pretty nice now :)
But I got a few more questions... :p
As my Demand Object also uses own model classes (e.g. @var
Tx_CdgLabors_Domain_Model_Labor) I now seem to manually initialize them...
$demandOverwrite = $this->initDemandOverwrite($demandOverwrite);
I just go through the array and replace all object uids with the object
$demandOverwrite['labor'] =
$this->laborRepository->findByUid($demandOverwrite['labor']);
it's pretty simple but I'm not sure if this is the best solution
available... e.g. for the demand object I didn't need to to that, yeah I
know extbase can't know this stuff for an array, but maybe some sort of
auto population could be done with a configuration? I'm just curious... :)
it works pretty nice and I can pass it on easily with
<f:link.action action="list" format="table"
arguments="{demand.overrideArray}">Tabellendarstellung</f:link.action>
for reference here is all the corresponding code
https://gist.github.com/853970
maybe you can take a look and tell me if you have an suggestions for
improvement... :)
cheers
--
+---------------------------------+-----------------------------------+
| Thomas Allmer | http://www.delusionworld.com |
| E-mail: at at delusionworld.com | phone: +43 699 16217064 |
+---------------------------------+-----------------------------------+
More information about the TYPO3-project-typo3v4mvc
mailing list