ViewHelper Documentation
cycle
This ViewHelper cycles through the specified values. This can be often used to specify CSS classes for example. Note: To achieve the "zebra class" effect in a loop you can also use the "iteration" argument of the for ViewHelper.
= Examples =
<f:for each="{0:1, 1:2, 2:3, 3:4}" as="foo"><f:cycle values="{0: 'foo', 1: 'bar', 2: 'baz'}" as="cycle">{cycle}</f:cycle></f:for>
<f:for each="{0:1, 1:2, 2:3, 3:4}" as="foo">
<f:cycle values="{0: 'odd', 1: 'even'}" as="zebraClass">
<li class="{zebraClass}">{foo}</li>
</f:cycle>
</f:for>
Arguments
values anySimpleType, required
The array or object implementing \ArrayAccess (for example \TYPO3\CMS\Extbase\Persistence\ObjectStorage) to iterated over
as string, required
The name of the iteration variable