[TYPO3-mvc] Fluid link ViewHelper - Dynamic array indexes

Sebastian Kurfürst sebastian at typo3.org
Thu May 12 07:50:41 CEST 2011


Hi Christian,

you are right that this is right now not possible inside Fluid Core; and
I doubt this would be possible without a complete re-write of the parser.
Furthermore, the given syntax would not be JSON anymore, which is what
we agreed upon for Arrays (as everybody knows it).

To solve it for now: I'd suggest to use a ViewHelper which will output
an array with defineable key and value, and then use it like:

<f:uri.page
    pageUid="{conf.targetPid}"
    additionalParams="{
        tx_myext_pi1: '{my:viewHelper(key: item.uid, value: \"somevalue\")}'
    }"
/>

The above should work.

BTW:

> And it is useful: Just think of a form with several elements and input
> fields. With POST, this is no problem, you create something like this
> is a <f:for> loop:
> <f:input ... name="tx_myext_pi1[articles][{currentItem.uid}][amount]"
> value="{currentItem.amount}" />
> Now you want to have the same as GET link for a specific item using
> the link or uri page viewhelper -> currently impossible. 
We will implement support for this in the Form-ViewHelpers directly.


Greets,
Sebastian


More information about the TYPO3-project-typo3v4mvc mailing list