[TYPO3-mvc] Use index of iteration attribute as array index
Claus Fassing
claus at fassing.eu
Sun Jun 26 16:06:56 CEST 2011
Hi Claus,
thank you for your answer.
Am 26.06.2011 14:43, schrieb Claus Due:
> I'm afraid that isn't possible. Fluid cannot tell wether you are referencing the variable "index" or requesting the property "index" on {imgSrc}... which is why the static {imgSrc.0} works but {imgSrc.index} does not.
I can't chain a variable and a property ?
> The solution could be to build an array of image names outside of Fluid - or use a ViewHelper to return an image name based on an index.
This is exactly what I did. I build the image name array (imgSrc) in my
controller and assign it to the view.
Greetz, Claus
More information about the TYPO3-project-typo3v4mvc
mailing list