From 2ee8e26622e28e1908a37492b1f5aa9cec1b60c5 Mon Sep 17 00:00:00 2001
From: Kevin Chabowski
Variables start with a $ or can be wrapped within ${ and }, so vou can write this: ${foo}ish
Variables start with a $ or can be wrapped within ${ and }, so you can write this: ${foo}ish
Variable have names, these names can consist of letters (english alphabet; upper and lower case), numbers and underscores (_). As a regex: [a-zA-Z0-9_]+
A variable can also be an array. To access an array, wrap the desired fieldname within [ and ]. A fieldname can be constructed of Text and othe Variables. So you can dynamically access fields: $foo[$bar]. These fieldnames can also be nested or concatenated: $foo[$bar[baz]][herp][$de[derp]]
A variable can also be an array. To access an array, wrap the desired fieldname within [ and ]. A fieldname can be constructed of Text and other Variables. So you can dynamically access fields: $foo[$bar]. These fieldnames can also be nested or concatenated: $foo[$bar[baz]][herp][$de[derp]]
If you want a literal $ char, you can escape it: \$
Variables in STE T/PL are typeless, everything ist text. In a boolean context, empty text usually represents false, else true.
+Variables in STE T/PL are typeless, everything is text. In a boolean context, empty text usually represents false, else true.
A Tag can be compared to a function. A Tag can have parameters and children elements.
@@ -112,11 +112,11 @@If the tag is self-closing, the last char is a / (e.g.: ]]>).
If the tag is a closing one, the first char is a /. An opening Tag does not have a /.An example of an opening-closing Tag pair wrapping the text bar: bar]]>
- Parameters of a tag consists of a name and the corresponding value (wrapped in " or ') seperated by an = .
- Parameters are seperated by any whitespace (space, tab or newline) char.
+ Parameters of a tag consists of a name and the corresponding value (wrapped in " or ') separated by an = .
+ Parameters are separated by any whitespace (space, tab or newline) char.
Parameter values can consist of Text and Variable elements but not of Tags!
If you need a literal " or ' in a parameter value, you can escape them: \" or \' .
- When using variables in paramter values, they will be "replaced" by their value. Because many tags need the variable and not its content, they expect only the variable's name. If you then write foo="$bar", the tag will not operate on the bar variable but on the Variable with the name stored in $bar! So read the instructions to the tag carefully!
+ When using variables in parameter values, they will be "replaced" by their value. Because many tags need the variable and not its content, they expect only the variable's name. If you then write foo="$bar", the tag will not operate on the bar variable but on the Variable with the name stored in $bar! So read the instructions to the tag carefully!
Example: de
Because if-clauses are used often, there is an short syntax:
?{condition|then|else}
This is equavilent to:
+This is equivalent to:
condition
?, {, | and } can be escaped
In this variant, the else part is not optional!
@@ -237,7 +237,7 @@ (wherex is either a or b).
- The operator is passed wth the op parameter. Following parameters are available:
+ The operator is passed with the op parameter. Following parameters are available:
If the comparasion was true, a non-empty text will be returned, otherwise an empty text, so you can use ste:cmp with ste:if
+If the comparisons was true, a non-empty text will be returned, otherwise an empty text, so you can use ste:cmp with ste:if
Example: Because comparisons are used often, there is an short syntax: This is equavilent to: This is equivalent to: Because this is implemented as a simple substitution, you can only use Text and Variables. And WARNING: short comparasions can not be nested! They can be inside short if-clauses, but not the other way around! WARNING: short comparisons can not be nested! They can be inside short if-clauses, but not the other way around! The ste:not Tag will logically invert its content. If it is an empty text (i.e. false), it will return a non-empty text (i.e. true) and vice versa.
@@ -286,11 +286,11 @@
Short syntax for if-clause
~{a|operator|b}]]>~, {, | and } can be escaped" must be escaped.ste:not
Create an infinitive loop. You can get out of the loop using the ste:break tag. Can be used to emulate othe loop constructs like while loops.
+Create 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.
Example: When this self-closing tag is called, the current loop(ste:for, ste:foreach, ste:infloop) will go to the next iteration, aborting the current iteration. This self-closing tag loads and executes anoter template. The This self-closing tag loads and executes another template. The Because each template must be parseable and transcompilable by itself, this is not a inclusion of another template. So you can not do this:
slave.tpl: To perform mathematical calculations, you can use ste:math. ste:math calculates the mathematical formula it is wrapped around and returns the result. The formula is in the usual infix-notation [ext. Link] and has these operators: To perform mathematical calculations, you can use ste:calc. ste:calc calculates the mathematical formula it is wrapped around and returns the result. The formula is in the usual infix-notation [ext. Link] and has these operators: Real numbers are supported, complex numbers not. Formulas are evaluated at runtime, not during transcompilation.
@@ -488,7 +488,7 @@
ste:mktag allows you to define own Tags using STE T/PL. The parameter The parameter The Variable With the ste:tagcontent tag you can execute the tags content. ste:mktag will be transcompiled like any other code. So your custom tag will be almost as fast as a plugin coded in PHP. The Standard Library contains some useful tags, which are not builtin but still always available. Escapes characters that are reserved for HTML (e.g. Escapes characters that are reserved for HTML (e.g.
Example: Increments (i.e. add 1) a variable (variable name given by parameter Decrements (i.e. substract 1) a variable (variable name given by parameter Decrements (i.e. subtract 1) a variable (variable name given by parameter Formats a time using PHPs strftime format [ext. Link]. The format is given in the tag's content. You can specify a time (unix timestamp) using the
@@ -419,7 +419,7 @@
ste:load
- name parameter (mandatory) defines the template to load.name parameter (mandatory) defines the template to load.
@@ -477,7 +477,7 @@
ste:calc
- +, -, *, / and ^. Numbers are always decimal, the decimal mark is . and numbers can be prefixed with an - to indicate a negative number. It is a good idea to wrap a negative number in brackets to prevent wrong evaluation (because - is also an operator). Calculations can be grouped with brackets: ( and ).+, -, *, / and ^. Numbers are always decimal, the decimal mark is . and numbers can be prefixed with an - to indicate a negative number. It is a good idea to wrap a negative number in brackets to prevent wrong evaluation (because - is also an operator). Calculations can be grouped with brackets: ( and ).ste:mktag
name (mandatory) expects the name of the new tag. If your tag requires some parameters, you can specify them using the optional mandatory parameter. Names of the mandatory parameters are seperated by |.name (mandatory) expects the name of the new tag. If your tag requires some parameters, you can specify them using the optional mandatory parameter. Names of the mandatory parameters are separated by |._tag_parameters (associative array) will hold all given parameters and their values.
@@ -517,7 +517,7 @@
Standard Library
ste:escape
- <, >, ", &). The text to escape ist the tag's content.
+ <, >, ", &). The text to escape is the tag's content.
@@ -535,7 +535,7 @@
Foo & bar...]]>
var).ste:dec
- var).var).ste:date
timestamp parameter (defaults to the current time).