문제

I have an action and a Twig-template.

Via render() it is possible to place a text for a Twig-tag {{ tagname }}.

But this text is escaped. Now I would like to place (not-escaped) HTML-code.

How is that done in Symfony2?

도움이 되었습니까?

해결책

Escaping is handled by Twig.

{{ var }} leads to escaped output.

{{ var|raw }} leads to raw/not-escaped output.

raw is a filter.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top