From a77a2ec58947f5fc7cb4023db3b8f8298e2f01f2 Mon Sep 17 00:00:00 2001
From: Kevin Chabowski
This code will loop through the array <ste:foreach array="foo" key="k" value="v" counter="i">
Number: $i<br />
Key: $k<br />
Value: $v<br />
<br />
</ste:foreach>foo
and return the counter $i
, the key $k
and the value $v
of the current iteration.
+ There can also be an optional <ste:else>
clause, that will be executed, if the input array was empty.
+
+ Example:
+
+ This code will list all array elements or will display <ste:foreach array="foo" value="v">
<p>$v</p>
<ste:else>
Array \$foo is empty.
</ste:else>
</ste:foreach>Array $foo is empty
if the array $foo
is empty.
+
Creates an infinitive loop. You can get out of the loop using the ste:break tag. Can be used to emulate other loop constructs like while loops.
-- cgit v1.2.3-70-g09d2