Answer the question
In order to leave comments, you need to log in
Filtering (escape vs raw) Twig variable output?
Record difference
{{ 'title.homepage' | trans }}
{{ 'title.homepage' | trans | raw }}
{% trans %} title.homepage {% endtrans %}
{% autoescape %}
{{ var | trans| raw }}
{% endautoescape %}
{% autoescape %}
{{ var | trans }}
{% endautoescape %}
{% set strategy = 'html' %}
{% autoescape 'html' %}
{{ var | trans |escape(strategy)|raw }}
{% endautoescape %}
{% set strategy = 'html' %}
{% autoescape 'html' %}
{{ var | trans |escape(strategy) }}
{% endautoescape %}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question