From 8e35fad33de1fbecea7c29776f7afab6a4b88a48 Mon Sep 17 00:00:00 2001 From: Kevin Chabowski Date: Sun, 15 Jan 2012 13:04:03 +0100 Subject: Added builtin ste:get and fixed a code generation bug. * ste:get allows us to get a variable's content dynamically. * (') was escaped for TextNodes, which resulted to: \' should have been: ' --- example/index.php | 4 ++++ example/templates/src/articles.html | 3 +++ 2 files changed, 7 insertions(+) (limited to 'example') diff --git a/example/index.php b/example/index.php index 3d2b1ca..14ca576 100644 --- a/example/index.php +++ b/example/index.php @@ -52,6 +52,10 @@ $ste->vars["articles"] = array( array("author" => "baz", "title" => "whatever...", "timestamp" => 1316550000, "excerpt" => "...", "full" => "..........") ); +$ste->vars["foo"] = "baz"; +$ste->vars["bar"] = "lol"; +$ste->vars["baz"] = array("lol" => "cool"); + # Execute the template and output the result echo $ste->exectemplate("articles.html"); diff --git a/example/templates/src/articles.html b/example/templates/src/articles.html index 108a3b8..0f20aeb 100644 --- a/example/templates/src/articles.html +++ b/example/templates/src/articles.html @@ -46,4 +46,7 @@

Bla

+ +

Get a variable's content dynamically

+ -- cgit v1.2.3-70-g09d2