pjiciw
Last Updated: February 25, 2016
·
810
· rodnaph
6e283a554e50ee3d10e5386f85816463

Twig Filter Escaping

When using filters, by default Twig will automatically try and escape the output data from the last filter in a chain to match the current context (eg. 'html'). If you don't want this behaviour then you need to mark your filter as safe.

'myFilter' => new Twig_Filter_Method(
    $this,
    'myFilter',
    array('is_safe' => array('html'))
);

The end.

Say Thanks
Respond