-
Notifications
You must be signed in to change notification settings - Fork 1
twig
Sébastien LUCAS edited this page Mar 11, 2014
·
10 revisions
- Reduce php verbosity
- easy to learn and less error prone by comparison with plain php
- Syntax {{}} as in handlebars
- Conditional structure to iterate on an array
{% for user in users %}
* {{ user.name }}
{% else %}
No users have been found.
{% endfor %}
- multiple inheritance, blocks, automatic output-escaping
{{ var }}
{{ var|e }} {# shortcut to escape a variable #}
- perfomance : compile to plain php (minimum overhead compared to php)