Fluid and translation · Question 9 of 12
A list should give the first entry a CSS class first and number every entry. How is this done with f:for?
1 answer is correct. Medium
Show answer
Answer
- B With iteration="i" and then {i.isFirst} and {i.cycle}
Explanation
The iteration argument creates a variable with index (starting at 0), cycle (starting at 1), total, isFirst, isLast, isEven and isOdd. cycle is suited for numbering, isFirst, isLast or isOdd for CSS classes. key only contains the array key of the current element, and there is no ViewHelper f:counter.