Closed fffixed closed 7 years ago
This syntax is deprecated in pugjs 2, and we will also drop it on the next major version: https://pugjs.org/api/migration-v2.html#attribute-interpolation
We implemented it in expression php/auto but it is not yet implemented js syntax in interpolation. I'm currently focused on the next major version that will use a new engine: https://github.com/phug-php made with @TorbenKoehn, the developer of tale-jade to provide a unique and reliable engine compliant with pugjs 2.0.
After that I could do this fix for those who won't upgrade.
For now I have not time enough but I would be happy to merge pull-requests for this if anyone would help.
But my main recommendation remains: do not use this syntax since pugjs 2 dropped it.
Sorry, this syntax is deprecated only for "Attribute Interpolation", not for "String Interpolation". And it works well till using word "comment" in variable's name. Please try this:
<?php
require_once '../vendor-php/autoload.php';
$pug = new Pug\Pug(array(
'expressionLanguage' => 'js',
'prettyprint' => true
));
$output = $pug->render("p fatal paragraf #{vars.comment}");
echo $output;
And
this ok: $pug->render("p= vars['comment']");
this ok: $pug->render("p= vars.nocomment");
this error: $pug->render("p= vars.comment");
Oh great, this is a good news because this is not about interpolation, it's a regression in js-phpize. And as it only seems to be a specific problem with comment, it should be fast to find.
Hi, please use composer update
to get js-phpize version 1.3.0. It should works since the following is OK in the compiler demo:
p #{vars.comment}
Wow! It's cool! Thank You!
If I use anywhere:
{vars.comment}
I have Fatal error!
'expressionLanguage' => 'js'