Created
April 7, 2015 12:48
-
-
Save morontt/60c71231a33a9b66c826 to your computer and use it in GitHub Desktop.
twig.js inline template
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
var html = twig({ ref: "user-profile" }).render({ | |
list: ["a", "b", "c"] | |
}); |
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
twig({ | |
id: "user-profile", | |
data: "<div class=\"discount-splash-action-details-outer\">\ | |
<div class=\"discount-splash _{{ percentDiscount|number_format }}\">\ | |
bis\ | |
<strong>-{% if percentDiscount is defined %}{{ percentDiscount }}%{% endif %}</strong>\ | |
</div>\ | |
</div>\ | |
<div class=\"discount-splash-action-details-outer display-none\">\ | |
<div class=\"discount-splash _{{ crossPrice|number_format }}\">\ | |
\ | |
<strong><s>{% if crossPrice is defined %}{{ crossPrice |number_format(0, ',', '.') }} €{% endif %}</s></strong>\ | |
</div>\ | |
</div>" | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment