Skip to content

Commit

Permalink
Merge pull request #68 from bryanagee/twig-1.12-compat
Browse files Browse the repository at this point in the history
Updates twig extension to work with twig 1.12-2.0
  • Loading branch information
pilot committed Oct 7, 2015
2 parents b03300c + 7f59fda commit 415e6f8
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Twig/Extension/TimeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
),
);
}

Expand Down

0 comments on commit 415e6f8

Please sign in to comment.