Twig

The flexible, fast, and secure
template engine for PHP

a Symfony Product
Docs Tags verbatim
You are reading the documentation for Twig 1.x. Switch to the documentation for Twig 2.x. 3.x.
Warning Twig version 1.x is no longer maintained.

Questions & Feedback

License

Twig documentation is licensed under the new BSD license.

verbatim

1.12

The verbatim tag was added in Twig 1.12 (it was named raw before).

The verbatim tag marks sections as being raw text that should not be parsed. For example to put Twig syntax as example into a template you can use this snippet:

1
2
3
4
5
6
7
{% verbatim %}
    <ul>
    {% for item in seq %}
        <li>{{ item }}</li>
    {% endfor %}
    </ul>
{% endverbatim %}

Note

The verbatim tag works in the exact same way as the old raw tag, but was renamed to avoid confusion with the raw filter.

Website powered by Symfony and Twig, deployed on
The Twig logo is © 2010-2024 Symfony