summaryrefslogtreecommitdiff
path: root/example/templates/src/custom_tags.tpl
diff options
context:
space:
mode:
authorKevin Chabowski <kevin@kch42.de>2011-09-21 00:15:45 +0200
committerKevin Chabowski <kevin@kch42.de>2011-09-21 00:15:45 +0200
commitfa1b95982a05ca860ada827b9fbdc9def1ac8952 (patch)
treed0b5f73b4caf57009d41f52ed9b590d79db61ec7 /example/templates/src/custom_tags.tpl
parent9ea6438809d1019cda096ac101904735ee2fec8e (diff)
downloadste-fa1b95982a05ca860ada827b9fbdc9def1ac8952.tar.gz
ste-fa1b95982a05ca860ada827b9fbdc9def1ac8952.tar.bz2
ste-fa1b95982a05ca860ada827b9fbdc9def1ac8952.zip
Added documentation, an example program and fixed some bugs...
Diffstat (limited to 'example/templates/src/custom_tags.tpl')
-rw-r--r--example/templates/src/custom_tags.tpl19
1 files changed, 19 insertions, 0 deletions
diff --git a/example/templates/src/custom_tags.tpl b/example/templates/src/custom_tags.tpl
new file mode 100644
index 0000000..7e821c5
--- /dev/null
+++ b/example/templates/src/custom_tags.tpl
@@ -0,0 +1,19 @@
+<ste:comment>A foreach that will break after 'max' iterations</ste:comment>
+<ste:mktag name="foreach_limit" mandatory="array|value|max">
+ <ste:foreach array="$_tag_parameters[array]" value="$_tag_parameters[value]" counter="i">
+ <ste:if>
+ <ste:cmp var_a="i" op="gte" var_b="_tag_parameters[max]" />
+ <ste:then>
+ <ste:break />
+ </ste:then>
+ </ste:if>
+
+ <ste:if>
+ $_tag_parameters[counter]
+ <ste:then>
+ <ste:set var="$_tag_parameters[counter]">$i</ste:set>
+ </ste:then>
+ </ste:if>
+ <ste:tagcontent />
+ </ste:foreach>
+</ste:mktag>