diff options
author | Kevin Chabowski <kevin@kch42.de> | 2011-09-21 00:15:45 +0200 |
---|---|---|
committer | Kevin Chabowski <kevin@kch42.de> | 2011-09-21 00:15:45 +0200 |
commit | fa1b95982a05ca860ada827b9fbdc9def1ac8952 (patch) | |
tree | d0b5f73b4caf57009d41f52ed9b590d79db61ec7 /example/templates/src/custom_tags.tpl | |
parent | 9ea6438809d1019cda096ac101904735ee2fec8e (diff) | |
download | ste-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.tpl | 19 |
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> |