Skip to content

Instantly share code, notes, and snippets.

@javiereguiluz
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save javiereguiluz/a8861994bbb10b5752d9 to your computer and use it in GitHub Desktop.
Save javiereguiluz/a8861994bbb10b5752d9 to your computer and use it in GitHub Desktop.
// original code
public function getFunctions()
{
return array(
new \Twig_SimpleFunction('show_source_code', array($this, 'showSourceCode'), array('is_safe' => array('html'), 'needs_environment' => true)),
);
}
// new code
public function getFunctions()
{
return array(
'show_source_code' => new \Twig_Function_Method(array($this, 'showSourceCode'), array('is_safe' => array('html'), 'needs_environment' => true)),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment