Closed webdevian closed 7 years ago
Hi,
PHP functions are allowed in JS mode:
if isset(url) && url
p ok
else
p ko
In PHP mode, just add the $
:
if isset($url) && $url
p ok
else
p ko
Next version will follow the tale-jade way and append isset
automatically.
isset is no longer necessary in pug-php 3 thanks to the check feature: https://phug.selfbuild.fr/#uncheck-check-code Hope you will enjoy this new version.
Using
'expressionLanguage' => 'js'
, I have the following code:It compiles to
If url is not defined in the locals I get a php warning
Undefined variable: url
.I would expect this if statement to evaluate the undefined
url
variable as falsey, and not throw a warningOr is there a different way I can write the if statement so that is compiles to something like
if(isset($url) || $url)
?