[TYPO3-mvc] Fluid - using an array in condition?

Stefan Isak stefanisak at googlemail.com
Tue May 11 14:12:01 CEST 2010


Hey Sebastian,

everything worked as expected. Thanks!

In a for each tag key="index" starts always at 0.
Is there a possibility to initialize the key to another value, or is it
necessary to build another ViewHelper for it?

E.g. <f:for each="{array}" as="element" key="index" value="5">

Cheers
Stefan


2010/5/10 Martin Kutschker <masi-no at spam-typo3.org>

> Sebastian Kurfürst schrieb:
> > Hey Stefan,
> >
> >> But it seems that "{checkedItems.index}" is not equivalent to
> >> {checkedItems.0}, {checkedItems.1}, ...
> >> Is there another syntax, or is it not possible?
> > Right now, that's not possible without a custom ViewHelper.
> >
> > The reason is that you would like to write {checkedItems.{index}}, which
> > is not supported right now... And from the parser side, I am not sure if
> > this still makes the language unambiquous. That's why I cannot guarantee
> > this feature will be implemented in the upcoming time.
>
> Would this help the parser?
>
> {checkedItems[{index}]}
>
> IIRC the parser uses regexps. Perhaps it's time to move on to a real lexer
> to allow for a more
> versatile syntax. eg I would like to see numeric arrays without the need to
> spell out the indices:
> ['a', 'b', 'c'] instead of {0: 'a', 1: 'b', 2:'c'}.
>
> Masi
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
>


More information about the TYPO3-project-typo3v4mvc mailing list