Twig uses a syntax similar to the Django and Jinja template languages.
Twig is the current templating engine used in the popular Symfony PHP framework.
Here are some key features of "Twig":
· Twig compiles templates down to plain optimized PHP code.
· Twig has a sandbox mode to evaluate untrusted template code.
· Twig is powered by a flexible lexer and parser.
· The developer can define its own custom tags and filters, and create its own DSL.
· Twig can be used as a template language for applications where users may modify the template design.
· Concise language.
· Clean error messages.
· Twig supports from multiple inheritance, blocks to automatic output-escaping, and much more.
· Unit tested.
· Documentation provided.
Requirements:
· PHP 5.2 or higher
What's New in This Release: [ read full changelog ]
· Enforced interface when adding tests, filters, functions, and node visitors from extensions
· Fixed a side-effect of the date filter where the timezone might be changed
· Simplified usage of the autoescape tag; the only (optional) argument is now the escaping strategy or false (with a BC layer)
· Added a way to dynamically change the auto-escaping strategy according to the template "filename"
· Changed the autoescape option to also accept a supported escaping strategy (for BC, true is equivalent to HTML)
· Added an embed tag