From 91b965181f907b169aeeff63a6c15f9b8df9d9a9 Mon Sep 17 00:00:00 2001
From: Kevin Chabowski $foo
is not empty, then Bar
will be executed, otherwise Baz
.
Because if-clauses are used often, there is an short syntax:
+Because if-clauses are used often, there is a short syntax:
?{condition|then|else}
This is equivalent to:
<ste:if>condition<ste:then>then</ste:then><ste:else>else</ste:else></ste:if>
array
key
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.
+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.
Example:
@@ -416,7 +416,7 @@
<ste:infloop>
<ste:if>
<ste:foo />
<ste:then><ste:break /></ste:then>
</ste:if>
...
<ste:infloop>
ste:block provides an easy way for writing master templates. Every block has a name. When a block is defined twice, the second will overwrite the first one.
+ste:block provides an easy way for writing master templates. Every block has a name. When a block is defined twice, the second one will overwrite the first one.
The name can be set with the name
parameter.
Example:
@@ -441,7 +441,7 @@
ste:get will return the content of a variable. The parameter var
takes the name of the variable to get. Usefult, if you want to get a variable which name is stored in a variable.
ste:get will return the content of a variable. The parameter var
takes the name of the variable to get. Useful, if you want to get a variable which name is stored in a variable.
Example:
diff --git a/docu/nd/files/stupid_template_engine-php.html b/docu/nd/files/stupid_template_engine-php.html
index 91d6080..937b766 100644
--- a/docu/nd/files/stupid_template_engine-php.html
+++ b/docu/nd/files/stupid_template_engine-php.html
@@ -61,7 +61,7 @@ if (browserType) {document.write("<ste:get var="$foo" />
public function __construct( $storage_access )
$storage_access | An Instance of a StorageAccess implementation. |
public function register_tag( $name, $callback )
Register a custom tag.
$name | The name of the tag. |
$callback | A callable function (This must tage three parameters: The STECore instance, an associative array of parameters, and a function representing the tags content(This expects the STECore instance as its only parameter and returns its text result, i.e to get the text, you neeed to call this function with the STECore instance as a parameter)). |
An Exception if the tag could not be registered (if $callback is not callable or if $name is empty)
public function register_tag( $name, $callback )
Register a custom tag.
$name | The name of the tag. |
$callback | A callable function (This must take three parameters: The STECore instance, an associative array of parameters, and a function representing the tags content(This expects the STECore instance as its only parameter and returns its text result, i.e to get the text, you neeed to call this function with the STECore instance as a parameter)). |
An Exception if the tag could not be registered (if $callback is not callable or if $name is empty)
public function call_tag( $name, $params, $sub )
Calling a custom tag (builtin ones can not be called)
$name | The Tag’s name |
$params | Associative array of parameters |
$sub | A callable function (expecting an STECore instance as it’s parameter) that represents the tag’s content. |
Might throw a FatalRuntimeError (see $fatal_error_on_missing_tag.
The output of the tag or, if a RuntimeError was thrown, the appropiate result (see $mute_runtime_errors).