[TYPO3-mvc] create array as viewhelper argument

Thomas Mammitzsch thomas at visualworx.de
Tue Mar 1 16:52:53 CET 2011


Am 01.03.2011 15:39, schrieb Thomas Allmer:
> On 28.02.2011 20:21, Thomas Mammitzsch wrote:
>> because i need to link to a certain action in a certain controller for
>> an entity i don't know which it is in that moment
>
> at what point to you know it? is the user selecting it? then you will
> have to use js?
>
>  > no. mykey and myvalue are variables containing a string.
>
> so these 2 values are available in the controller right?
> I mean you can just create an array in the controller and pass it on
You are right, that worked. Things can be so simple.
>
> $this->view->assign('myArguments', array('format' => 'table', 'action'
> => 'list'));
>
> <f:link.action arguments="{myArguments}">link</f:link.action>
>
> building arrays inside the view is probably not the right context and I
> guess it's not easily possible...
it seems like that. But building the array in the controller is fine for me.
>
> I'm still not sure if I get what are you trying to do...

ok, maybe this is a bit too much detail, but you wanted to know:
I have a large extension with lots of entities and actions linked to 
each other. I build a session based breadcrumb widget for this, because 
all the views are of course no real pages. So i have to handle any kind 
of entity with its uid in the viewhelper.

thanks for the hint and regards, Thomas


More information about the TYPO3-project-typo3v4mvc mailing list