简体   繁体   中英

Render twig-template with dynamically placed HTML in Symfony2?

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM