AndyB Well-known member Jan 7, 2020 #1 I would like to get $i to start at 0. The following code does not work, $i it always starts at 1. Code: <xf:set var="$i" value="0" /> <xf:foreach loop="$results" value="$result" i="$i"> {$i} </xf:foreach> Thank you.
I would like to get $i to start at 0. The following code does not work, $i it always starts at 1. Code: <xf:set var="$i" value="0" /> <xf:foreach loop="$results" value="$result" i="$i"> {$i} </xf:foreach> Thank you.
AndyB Well-known member Jan 7, 2020 #2 Got it: Code: <xf:foreach loop="$results" value="$result" i="$i"> {{ $i - 1 }} </xf:foreach>