开发者

Render twig-template with dynamically placed HTML in Symfony2?

开发者 https://www.devze.com 2023-03-22 14:09 出处:网络
I have an action and a Twig-template. Via render() it is possible to place a text for a Twig-tag开发者_高级运维 {{ tagname }}.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号