diff --git a/example.php b/examples/example.php similarity index 91% rename from example.php rename to examples/example.php index 1ea3fa1..53d98e4 100644 --- a/example.php +++ b/examples/example.php @@ -1,6 +1,6 @@ compile('template2.html'); diff --git a/example3.php b/examples/example3.php similarity index 83% rename from example3.php rename to examples/example3.php index fba906a..2189a2e 100644 --- a/example3.php +++ b/examples/example3.php @@ -2,8 +2,7 @@ $data = array('phedor', 'andrey'); - -require_once 'klein.php'; +require_once '../klein.php'; $tpl = new Klein(); $tpl->compile('template3.html'); diff --git a/tempalte.html b/examples/tempalte.html similarity index 100% rename from tempalte.html rename to examples/tempalte.html diff --git a/template2.html b/examples/template2.html similarity index 100% rename from template2.html rename to examples/template2.html diff --git a/template3.html b/examples/template3.html similarity index 96% rename from template3.html rename to examples/template3.html index f5fa1f2..203fede 100644 --- a/template3.html +++ b/examples/template3.html @@ -1,8 +1,8 @@ -
{% macro hello(name) %} hello, {{ name }} {{! name }} {% endmacro %} +
{% for name in names %} {{ hello(name) }} {% endfor %} diff --git a/klein.php b/klein.php index bd3d242..6ca1a72 100644 --- a/klein.php +++ b/klein.php @@ -11,7 +11,8 @@ class Klein { function ($x) use ($result) { $code = ""; return ($x[0][2] == '!') ? "" : $code; }];