Edit on GitHub
Jump to docs navigation

Twig Components / Methods / apply

Note: You are currently reading the documentation for Bolt 5.0. Looking for the documentation for Bolt 5.2 instead?

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.