Skip to content

ami-team/AMITwigJS

Repository files navigation

LPSC      IN2P3      UGA      CERN      CERN

AMI-TWIG.js

AMI-TWIG.js is a JavaScript implementation for both NodeJS and browsers of the SensioLabs's TWIG template engine.

Getting started

Loading AMI-Twig.js server-side:

let amiTwig = require('ami-twig.min.js').amiTwig;

Loading AMI-Twig.js client-side:

<script type="text/javascript" src="ami-twig.min.js"></script>

Using AMI-Twig.js:

let textResult = amiTwig.engine.render(twigTemplate, optionalDict, optionalTwigTemplates);

where optionalDict contains all the global variables for the template.

For optimization perposes, templates can be compiled before rendering:

let compiledTemplate = amiTwig.engine.compile(twigTemplate);

let textResult = amiTwig.engine.render(compiledTemplate, optionalDict, optionalTwigTemplates);

Developers

About

No description, website, or topics provided.

Resources

License

Unknown and 2 other licenses found

Licenses found

Unknown
LICENSE.md
Unknown
LICENSE-EN
Unknown
LICENSE-FR

Stars

Watchers

Forks

Packages

No packages published