Skip to content

Commit

Permalink
add test for #44
Browse files Browse the repository at this point in the history
  • Loading branch information
Zordius Chen committed Jun 4, 2014
1 parent e5a8fe3 commit e19227e
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/issue44.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
require('src/lightncandy.php');

$template = '<div class="terms-text"> {{render "artists-terms"}} </div>';

$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";

?>

0 comments on commit e19227e

Please sign in to comment.