From d0b7317e10254490acbe748d1d8c1e04aaf8be6b Mon Sep 17 00:00:00 2001
From: Kevin Chabowski
Date: Wed, 27 Jun 2012 21:09:07 +0200
Subject: Added new Tags to the standard library.
* ste:in_array checks, if a value is in an array
* ste:join joins an array with a glue string
* ste:split splits a string with a delimiter to an array
* ste:array_add adds an element to an array.
---
docu/language_definition.html | 19 +
docu/nd/files/stupid_template_engine-php.html | 12 +-
example/templates/transc/articles.html.php | 172 +++++++++
example/templates/transc/custom_tags.tpl.php | 65 ++++
example/templates/transc/master.html.php | 503 ++++++++++++++++++++++++++
stupid_template_engine.php | 38 ++
6 files changed, 803 insertions(+), 6 deletions(-)
create mode 100644 example/templates/transc/articles.html.php
create mode 100644 example/templates/transc/custom_tags.tpl.php
create mode 100644 example/templates/transc/master.html.php
diff --git a/docu/language_definition.html b/docu/language_definition.html
index c4dd98b..4cf4aaf 100644
--- a/docu/language_definition.html
+++ b/docu/language_definition.html
@@ -77,6 +77,10 @@
ste:inc
ste:dec
ste:date
+ ste:in_array
+ ste:join
+ ste:split
+ ste:array_add
@@ -498,5 +502,20 @@
Result:
18. Sep. 2011, 16:49:20
+
+ ste:in_array
+ Check, if a value is in an array. The tag takes the variable name of the array by parameter array
.The value to test with will be taken from the tags content.
+ Returns empty text, if the value is not in the array, otherwise a non-empty text.
+
+ ste:join
+ Join parts of an array together. The array's variable name goes to the array
parameter. The tag's content will be used as the glue, i.e. this will be between two elements.
+ Returns the joined array
+
+ ste:split
+ Split a text and write the parts to an array. The array
parameter takes the variable name of the resulting array, the delim
parameter the text to split by. The tag's content will be the text to split.
+
+ ste:array_add
+ Adding an element to an array. The array
parameter takes the variable name of the array. The key
parameter takes the array key to map the value to, if omitted, the value will be appended to the end of the array. The value is the tag's content.
+