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 "<strong>some text</strong>" #}
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.
Couldn't find what you were looking for? We are happy to help you in the forum, on Slack or on Github.