Last active
October 26, 2017 10:59
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//- 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