Edit on GitHub
Jump to docs navigation

Twig Components / Methods / apply

apply is a Twig tag to allow you to apply Twig filters on a block of template data:

{% apply upper %}

    This text becomes uppercase

{% endapply %}

You can also chain filters and pass arguments to them:

{% apply lower|escape('html') %}
   <strong>SOME TEXT</strong>
{% endapply %}`
{# outputs "&lt;strong&gt;some text&lt;/strong&gt;" #}

Source: Twig



Edit this page on GitHub
Couldn't find what you were looking for? We are happy to help you in the forum, on Slack or on Github.