oroce / gulp-jade-php

MIT License
11 stars 9 forks source link

js conditionals rendering as php #4

Closed bkcummins closed 9 years ago

bkcummins commented 9 years ago

If I do the basic conditional below in gulp-jade and gulp-jade-php i get two different results.

- var foo = {greetings:"bob"}
div
  | hello 
  if foo
    | #{foo.greetings}
  else
    | world

gulp-jade output:

<div>hello bob</div>

gulp-jade-php output:

<?php var foo = {greetings:"bob"} ?>
<div>hello<?php if ( foo) ?>foo.greetings<?php else ?>world</div>

How do you do js conditionals w gulp-jade-php?

It seems like php conditionals should be written after "-" or "=".

Thx in advance!

bkcummins commented 9 years ago

inline conditional works

example

a(href=(field.url !== '')? field.url : undefined) #{ field.title }
oroce commented 9 years ago

actually I have no clue :( this module just wraps jade-php.

You should ask there, you'll more likely get a better/more accurate answer.