mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-11 18:06:46 +00:00
c75d5952e357f347d2056d8fd2685f491eaab9cd
Commits
-------
e4590d0 Avoid creating unnecessary Twig_Markup instances, allows testing for falsiness of empty output
Discussion
----------
Avoid creating unnecessary Twig_Markup instances
This allows testing for falsiness of an empty output:
```jinja
{% set foo %}{% block lala %}{% endblock %}{% endset %}
{% if foo %}
some output with {{ foo }}
{% endif %}
```
Currently this requires `{% if foo|length %}` since the set tag will always return a Twig_Markup.
…
…
…
Twig, the flexible, fast, and secure template language for PHP
Twig is a template language for PHP, released under the new BSD license (code and documentation).
Twig uses a syntax similar to the Django and Jinja template languages which inspired the Twig runtime environment.
More Information
Read the documentation for more information.
Description
Languages
PHP
99.9%