Skip to content
New issue

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

Multiple conditionals not working correctly #72

Closed
stefanatg2 opened this issue Oct 7, 2016 · 2 comments
Closed

Multiple conditionals not working correctly #72

stefanatg2 opened this issue Oct 7, 2016 · 2 comments
Labels
Milestone

Comments

@stefanatg2
Copy link

&& statements not working properly. PugGlobals are used.

if entryopen and !submitted
    button

but nested

if entryopen
    if submitted == false
        button

works.

@kylekatarnls
Copy link
Member

Hi,

For the moment, you have to call the variables with the PHP dollar in such conditions:

if $entryopen and !$submitted
  button

@kylekatarnls kylekatarnls modified the milestones: js-phpize, 2.5 Dec 2, 2016
@kylekatarnls
Copy link
Member

Hi, if entryopen and !submitted is not possible because it's neither valid PHP nor valid JS, but you can now (by upgrading to the last version) use:

$pug = new Pug(array('expressionLanguage' => 'js'));

with:

if entryopen && !submitted
    button

Or:

$pug = new Pug(array('expressionLanguage' => 'php'));

with:

if $entryopen and !$submitted
    button

PS: && is also available in PHP mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants