From e19227ed6d0b267fe3eb09bb0e61ffbc6c994ddb Mon Sep 17 00:00:00 2001 From: Zordius Chen Date: Wed, 4 Jun 2014 17:42:29 +0800 Subject: [PATCH] add test for #44 --- tests/issue44.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tests/issue44.php diff --git a/tests/issue44.php b/tests/issue44.php new file mode 100644 index 00000000..ec7c35ec --- /dev/null +++ b/tests/issue44.php @@ -0,0 +1,26 @@ + {{render "artists-terms"}} '; + +$compileOptions = [ + 'flags' => LightnCandy::FLAG_HANDLEBARSJS, + 'helpers' => [ + 'url', + 'render' => function($view,$data = array()) { + return View::make($view,$data); + } + ] +]; + +$php = LightnCandy::compile($template, $compileOptions); + +echo "Rendered PHP code is:\n$php\n\n"; + +$renderer = LightnCandy::prepare($php); + +echo "Render esult:\n"; +echo $renderer(Array('id' => 'bla bla bla', 'a' => Array('id' => 'OK!'))); +echo "\n"; + +?>