Skip to content

Instantly share code, notes, and snippets.

@jjhoncv
Last active October 26, 2017 10:59
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jjhoncv/a6efea5eeb7937cb6f90 to your computer and use it in GitHub Desktop.
Save jjhoncv/a6efea5eeb7937cb6f90 to your computer and use it in GitHub Desktop.
Gits help to how to pass and array of objects to jade or multiline object jade also integration jade with php also jade with html
//- Is only jade with var text type
- var list = []
- list.push({status: "active", text: "option 1"})
- list.push({status: "", text: "option 2"})
- list.push({status: "", text: "option 3"})
each(item, index in list)
li(class="#{item.status}")
a= item.text
//- Is only jade with var type text and var html type.
- var list = []
- list.push({status: "active", text: "option 1"})
- list.push({status: "", text: "<strong>option 2</strong>"})
- list.push({status: "", text: "option 3"})
each(item, index in list)
li(class="#{item.status}")
a= !{item.text}
//- Now for other language side back for example PHP:
- var list = []
- list.push({status: "<?php echo $status1;?>", text: "option 1"})
- list.push({status: "<?php echo $status2;?>", text: "<strong>option 2</strong>"})
- list.push({status: "<?php echo $status3;?>", text: "option 3"})
each(item, index in list)
li(class!="#{item.status}")
a= !{item.text}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment