We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
require('../vendor/autoload.php'); use LightnCandy\LightnCandy; $fileName = "lightncandy_" . (intval(microtime(true) * 1000)) . ".php"; $tmpl = "{{{{raw}}}} {{bar}} {{{{/raw}}}} {{bar}}"; echo "The template is : $tmpl\n"; $phpStr = LightnCandy::compile($tmpl, array( 'helpers' => array( // THE MISSING RAW HELPER HERE..... 'raw' => function ($op) { return $op['fn'](); } ), 'flags' => LightnCandy::FLAG_ERROR_LOG | LightnCandy::FLAG_SLASH | LightnCandy::FLAG_RAWBLOCK )); $filePath = 'tmp_' . $fileName; file_put_contents($filePath, '<?php ' . $phpStr . ' ?>'); $renderer = include($filePath); unlink($filePath); $variables = [ 'bar' => "content" ]; $html = $renderer($variables); echo $html;
The JS reference: https://jsfiddle.net/1bn4vktm/2/
Look's like after any {{{{raw}}}} {{{{/raw}}}} block all other template variables are ignored. JS code output: {{{{raw}}}} {{bar}}} {{{{/raw}}}} {{bar}} ---> {{bar}}} content PHP code output: {{{{raw}}}} {{bar}} {{{{/raw}}}} {{bar}} ---> {{bar}} {{bar}}
{{{{raw}}}} {{{{/raw}}}}
{{{{raw}}}} {{bar}}} {{{{/raw}}}} {{bar}}
{{bar}}} content
{{{{raw}}}} {{bar}} {{{{/raw}}}} {{bar}}
{{bar}} {{bar}}
Am I missing something?
The text was updated successfully, but these errors were encountered:
Correctly parse handlebars after raw block
16cce03
Fixes zordius/lightncandy#344
This was caused by incorrect logic in the Validator::rawblock() handler. I have fixed this in my fork: https://github.com/devtheorem/php-handlebars.
Validator::rawblock()
Sorry, something went wrong.
No branches or pull requests
The PHP Code:
The Issue:
The JS reference:
https://jsfiddle.net/1bn4vktm/2/
Look's like after any
{{{{raw}}}} {{{{/raw}}}}
block all other template variables are ignored.JS code output:
{{{{raw}}}} {{bar}}} {{{{/raw}}}} {{bar}}
--->{{bar}}} content
PHP code output:
{{{{raw}}}} {{bar}} {{{{/raw}}}} {{bar}}
--->{{bar}} {{bar}}
Am I missing something?
The text was updated successfully, but these errors were encountered: