diff --git a/Twig/Extension/TimeExtension.php b/Twig/Extension/TimeExtension.php index 9faf4d0..e577cbc 100644 --- a/Twig/Extension/TimeExtension.php +++ b/Twig/Extension/TimeExtension.php @@ -34,18 +34,22 @@ public function __construct(TimeHelper $helper) public function getFunctions() { return array( - 'time_diff' => new \Twig_Function_Method($this, 'diff', array( - 'is_safe' => array('html') - )) + new \Twig_SimpleFunction( + 'time_diff', + array($this, 'diff'), + array('is_safe' => array('html')) + ), ); } public function getFilters() { return array( - 'ago' => new \Twig_Filter_Method($this, 'diff', array( - 'is_safe' => array('html') - )) + new \Twig_SimpleFilter( + 'ago', + array($this, 'diff'), + array('is_safe' => array('html')) + ), ); }