Developer(s) SensioLabs | Development status Active | |
Original author(s) Initial release October 12, 2009 (2009-10-12) Stable release 1.24.0 / January 26, 2016 (2016-01-26) |
Twig is a template engine for the PHP programming language. Its syntax originates from Jinja and Django templates. It's an open source product licensed under a BSD License and maintained by Fabien Potencier. The initial version was created by Armin Ronacher. Symfony2 PHP framework comes with a bundled support for Twig as its default template engine.
Contents
Features
Twig is supported by the following integrated development environments:
And the text editors:
Syntax
Twig defines three kinds of delimiters:
{{ parent() }}
).The apostrophe (') is the escape character.
The operators precedence is, from the less to more priority:
Example
The example below demonstrates some basic features of Twig.
References
Twig (template engine) Wikipedia(Text) CC BY-SA