Last active
August 29, 2015 13:57
-
-
Save HenderOrlando/9398947 to your computer and use it in GitHub Desktop.
En el ejemplo vemos que la plantilla llamada "TemplateName" recibe un arreglo llamado "dato". Tener en cuenta que la plantilla llamada "templateName" debe pasarse como variable, es decir, sin comillas, como lo estamos viendo.
This file contains hidden or 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 output = Twig.render(templateName, { | |
| dato: [ | |
| { | |
| url : 'url/from/js', | |
| class : 'class-js', | |
| attrs : 'attrs=""', | |
| heading : 'JS Loaded', | |
| text : 'Plantilla cargada desde JS', | |
| badge : { | |
| url : 'url/Badge', | |
| class : 'class', | |
| attrs : 'attrs=""', | |
| text : 'texto', | |
| }, | |
| } | |
| ] | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment