Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Switch to namespaced Twig classes #214

Merged
merged 2 commits into from Nov 21, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions Twig/PagerfantaExtension.php
Expand Up @@ -18,13 +18,15 @@
use Symfony\Component\PropertyAccess\PropertyAccess;
use Symfony\Component\PropertyAccess\PropertyPath;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;

/**
* PagerfantaExtension.
*
* @author Pablo Díez <pablodip@gmail.com>
*/
class PagerfantaExtension extends \Twig_Extension
class PagerfantaExtension extends AbstractExtension
{
private $defaultView;
private $viewFactory;
Expand All @@ -46,8 +48,8 @@ public function __construct($defaultView, ViewFactory $viewFactory, UrlGenerator
public function getFunctions()
{
return array(
new \Twig_SimpleFunction('pagerfanta', array($this, 'renderPagerfanta'), array('is_safe' => array('html'))),
new \Twig_SimpleFunction('pagerfanta_page_url', array($this, 'getPageUrl')),
new TwigFunction('pagerfanta', array($this, 'renderPagerfanta'), array('is_safe' => array('html'))),
new TwigFunction('pagerfanta_page_url', array($this, 'getPageUrl')),
);
}

Expand Down