Skip to content

Commit

Permalink
Update SphinxsearchExtension.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Lipsky committed Aug 2, 2018
1 parent 9123ee5 commit fe1b382
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Twig/SphinxsearchExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
namespace IAkumaI\SphinxsearchBundle\Twig;

use IAkumaI\SphinxsearchBundle\Search\Sphinxsearch;

use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;

/**
* Twig extension for Sphinxsearch bundle
*/
class SphinxsearchExtension extends \Twig_Extension
class SphinxsearchExtension extends AbstractExtension
{
/**
* @var Sphinxsearch
Expand Down Expand Up @@ -51,7 +52,7 @@ public function sphinx_highlight($text, $index, $query, $options = array())
public function getFilters()
{
return array(
'sphinx_highlight' => new \Twig_SimpleFunction('sphinx_highlight', array('is_safe' => array('html'))),
new TwigFilter('sphinx_highlight', array($this, 'sphinx_highlight'), array('is_safe' => array('html'))),
);
}

Expand Down

0 comments on commit fe1b382

Please sign in to comment.