diff options
Diffstat (limited to 'vendor/zordius/lightncandy/tests/example_debug.php')
-rw-r--r-- | vendor/zordius/lightncandy/tests/example_debug.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/vendor/zordius/lightncandy/tests/example_debug.php b/vendor/zordius/lightncandy/tests/example_debug.php new file mode 100644 index 00000000..bc573e0d --- /dev/null +++ b/vendor/zordius/lightncandy/tests/example_debug.php @@ -0,0 +1,28 @@ +<?php +require('src/lightncandy.php'); + +$template = "Hello! {{name}} is {{gender}}. +Test1: {{@root.name}} +Test2: {{@root.gender}} +Test3: {{../test3}} +Test4: {{../../test4}} +Test5: {{../../.}} +Test6: {{../../[test'6]}} +{{#each .}} +each Value: {{.}} +{{/each}} +{{#.}} +section Value: {{.}} +{{/.}} +{{#if .}}IF OK!{{/if}} +{{#unless .}}Unless not OK!{{/unless}} +"; + +$php = LightnCandy::compile($template, Array( + 'flags' => LightnCandy::FLAG_RENDER_DEBUG | LightnCandy::FLAG_HANDLEBARSJS +)); + +$renderer = LightnCandy::prepare($php); +error_reporting(0); +echo $renderer(Array('name' => 'John'), LCRun3::DEBUG_TAGS_ANSI); +?> |