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.
Written by Rhodri Pugh
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Php
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#