escape - Twig Filter

Details

This page shows version 4.x. The current version can be found here.

Contao overrides Twig’s default escape filter to employ its own escaper strategies.

Double Encoding Prevention

As mention in other sections, Contao uses input encoding by default which would then lead to double encoded output when rendering content in Twig. Contao overrides this behavior for templates within the @Contao and @Contao_* namespaces.

{# Outputs > i.e. without double encoding #}
{{ '>'|e }}

You can find more information in the double encoding section of the Twig architecture article.