This repository has been archived by the owner on Nov 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #214 from mynameisbogdan/master
Switch to namespaced Twig classes
- Loading branch information
Showing
2 changed files
with
9 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 <[email protected]> | ||
*/ | ||
class PagerfantaExtension extends \Twig_Extension | ||
class PagerfantaExtension extends AbstractExtension | ||
{ | ||
private $defaultView; | ||
private $viewFactory; | ||
|
@@ -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')), | ||
); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters