Prevent output escaping in Twig function extension
08:07 31 Mar 2013

I have created a Twig extension:

{{ image ("image.png", 200) }}

HI know I can just do

{{ image ("image.png", 200)|raw }}

...but I would prefer to use PHP code so that everything (from this 'image' extension) is not escaped.

I can't see this possible.

I know I can prevent all output escaping in Twig, but I just want this one extension not to escape output, and everything else to do so.

symfony twig