a Sensio Labs Product

The flexible, fast, and secure
template engine for PHP

Tags » filter

Questions & Feedback

License

Twig documentation is licensed under the new BSD license.

filterΒΆ

Filter sections allow you to apply regular Twig filters on a block of template data. Just wrap the code in the special filter section:

1
2
3
{% filter upper %}
    This text becomes uppercase
{% endfilter %}

You can also chain filters:

1
2
3
4
5
{% filter lower|escape %}
    <strong>SOME TEXT</strong>
{% endfilter %}

{# outputs "&lt;strong&gt;some text&lt;/strong&gt;" #}
This website is powered by PHP and Twig. The Twig logo is © 2010-2012 Sensio Labs