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

Commit

Permalink
Merge pull request #214 from mynameisbogdan/master
Browse files Browse the repository at this point in the history
Switch to namespaced Twig classes
  • Loading branch information
sampart authored Nov 21, 2019
2 parents 3ae0171 + 5437a2d commit f492615
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 5 additions & 3 deletions Twig/PagerfantaExtension.php
Original file line number Diff line number Diff line change
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
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
],
"require": {
"php": ">=5.3",
"php": ">=5.3.3",
"pagerfanta/pagerfanta": "^1.1.0|^2.0.0",
"symfony/framework-bundle": "~2.3|~3.0|~4.0",
"symfony/property-access": "~2.3|~3.0|~4.0",
Expand All @@ -22,6 +22,9 @@
"symfony/symfony": "~2.3|~3.0|~4.0",
"phpunit/phpunit": "~3.7|~4.0|^5.0"
},
"conflict": {
"twig/twig": "<1.34"
},
"autoload": {
"psr-4": {
"WhiteOctober\\PagerfantaBundle\\": ""
Expand Down

0 comments on commit f492615

Please sign in to comment.