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 Created with AI

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.

Certifications & exams

Which exam comes next?

You can already practise for 51 exams, and 16 are up for a vote. See all certifications with their official information, cast your vote or suggest your exam.

See all certifications