summaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
Diffstat (limited to 'example')
-rw-r--r--example/index.php24
1 files changed, 12 insertions, 12 deletions
diff --git a/example/index.php b/example/index.php
index caf57eb..0213c34 100644
--- a/example/index.php
+++ b/example/index.php
@@ -45,22 +45,22 @@ $ste->register_tag(
);
# assign some data
-$ste->vars["users"] = array(
- array("name" => "Foo", "username" => "foo", "online" => true),
- array("name" => "Bar", "username" => "bar", "online" => false),
- array("name" => "Baz", "username" => "baz", "online" => true)
-);
+$ste->vars["users"] = [
+ ["name" => "Foo", "username" => "foo", "online" => true],
+ ["name" => "Bar", "username" => "bar", "online" => false],
+ ["name" => "Baz", "username" => "baz", "online" => true]
+];
$ste->vars["title"] = "cool";
-$ste->vars["articles"] = array(
- array("author" => "foo", "title" => "cool article", "timestamp" => 1316553353, "excerpt" => "bla", "full" => "blablabla"),
- array("author" => "bar", "title" => "awesome", "timestamp" => 1316552000, "excerpt" => "...", "full" => ".........."),
- array("author" => "baz", "title" => "<ingenious", "timestamp" => 1316551000, "excerpt" => "...", "full" => ".........."),
- array("author" => "baz", "title" => "whatever...", "timestamp" => 1316550000, "excerpt" => "...", "full" => "..........")
-);
+$ste->vars["articles"] = [
+ ["author" => "foo", "title" => "cool article", "timestamp" => 1316553353, "excerpt" => "bla", "full" => "blablabla"],
+ ["author" => "bar", "title" => "awesome", "timestamp" => 1316552000, "excerpt" => "...", "full" => ".........."],
+ ["author" => "baz", "title" => "<ingenious", "timestamp" => 1316551000, "excerpt" => "...", "full" => ".........."],
+ ["author" => "baz", "title" => "whatever...", "timestamp" => 1316550000, "excerpt" => "...", "full" => ".........."]
+];
$ste->vars["foo"] = "baz";
$ste->vars["bar"] = "lol";
-$ste->vars["baz"] = array("lol" => "cool");
+$ste->vars["baz"] = ["lol" => "cool"];
# Execute the template and output the result
echo $ste->exectemplate("articles.html");