summaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorLaria Carolin Chabowski <laria@laria.me>2020-04-30 09:38:05 +0200
committerLaria Carolin Chabowski <laria@laria.me>2020-04-30 09:38:25 +0200
commit2381c52c690342f773a7cfa500387b6bfad76952 (patch)
tree340296ea529e40b81012c936703429a86481788e /example
parent2d26169b367af60cbc03d417c09918f50aa3b882 (diff)
downloadste-2381c52c690342f773a7cfa500387b6bfad76952.tar.gz
ste-2381c52c690342f773a7cfa500387b6bfad76952.tar.bz2
ste-2381c52c690342f773a7cfa500387b6bfad76952.zip
Automatic code formatting
Also add git hooks that checks formatting
Diffstat (limited to 'example')
-rw-r--r--example/index.php20
1 files changed, 11 insertions, 9 deletions
diff --git a/example/index.php b/example/index.php
index bd03a43..4a96410 100644
--- a/example/index.php
+++ b/example/index.php
@@ -14,29 +14,31 @@ $ste = new ste\STECore(
);
# Set STE to a more verbose behavior:
-$ste->mute_runtime_errors = False;
+$ste->mute_runtime_errors = false;
# First, lets define some custom tags.
# <ste:uppercase> will exchange all letters with their uppercase complement
-$ste->register_tag("uppercase",
- function($ste, $params, $sub)
- {
+$ste->register_tag(
+ "uppercase",
+ function ($ste, $params, $sub) {
$text = $sub($ste); # Get the tags content
return strtoupper($text); # Return the new text.
}
);
# <ste:repeat> will repeat its content n times (<ste:for> could be used too, but i needed more examples :-P )
-$ste->register_tag("repeat",
- function($ste, $params, $sub)
- {
+$ste->register_tag(
+ "repeat",
+ function ($ste, $params, $sub) {
$output = "";
- if(!is_numeric($params["n"]))
+ if (!is_numeric($params["n"])) {
throw new ste\RuntimeError("Sorry, but parameter n must be a number...");
+ }
- for($i = 0; $i < $params["n"]; ++$i)
+ for ($i = 0; $i < $params["n"]; ++$i) {
$output .= $sub($ste);
+ }
return $output;
}