From a77a2ec58947f5fc7cb4023db3b8f8298e2f01f2 Mon Sep 17 00:00:00 2001 From: Kevin Chabowski Date: Mon, 28 Oct 2013 18:09:50 +0100 Subject: ste:foreach now has an else clause for empty arrays. --- docu/language_definition.html | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'docu/language_definition.html') diff --git a/docu/language_definition.html b/docu/language_definition.html index a21a869..84232de 100644 --- a/docu/language_definition.html +++ b/docu/language_definition.html @@ -380,6 +380,14 @@
<ste:foreach array="foo" key="k" value="v" counter="i">
Number: $i<br />
Key: $k<br />
Value: $v<br />
<br />
</ste:foreach>
This code will loop through the array 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:
+

<ste:foreach array="foo" value="v">
<p>$v</p>
<ste:else>
Array \$foo is empty.
</ste:else>
</ste:foreach>
+ This code will list all array elements or will display Array $foo is empty if the array $foo is empty. +

ste:infloop

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