-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
7 additions
and
5 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 |
---|---|---|
|
@@ -19,13 +19,15 @@ | |
use Pd\MenuBundle\Render\RenderInterface; | ||
use Psr\Container\ContainerInterface; | ||
use Symfony\Component\Translation\TranslatorInterface; | ||
use Twig\Extension\AbstractExtension; | ||
use Twig\TwigFunction; | ||
|
||
/** | ||
* Menu Twig Extension. | ||
* | ||
* @author Kerem APAYDIN <[email protected]> | ||
*/ | ||
class MenuExtension extends \Twig_Extension | ||
class MenuExtension extends AbstractExtension | ||
{ | ||
/** | ||
* @var RenderInterface | ||
|
@@ -77,14 +79,14 @@ public function __construct(RenderInterface $engine, ItemProcessInterface $itemP | |
/** | ||
* Create Twig Function. | ||
* | ||
* @return array|\Twig_Function[] | ||
* @return array | ||
*/ | ||
public function getFunctions() | ||
{ | ||
return [ | ||
new \Twig_SimpleFunction('pd_menu_render', [$this, 'renderMenu'], ['is_safe' => ['html']]), | ||
new \Twig_SimpleFunction('pd_menu_get', [$this, 'getMenu']), | ||
new \Twig_SimpleFunction('arrayToAttr', [$this, 'arrayToAttr'], ['is_safe' => ['html']]), | ||
new TwigFunction('pd_menu_render', [$this, 'renderMenu'], ['is_safe' => ['html']]), | ||
new TwigFunction('pd_menu_get', [$this, 'getMenu']), | ||
new TwigFunction('arrayToAttr', [$this, 'arrayToAttr'], ['is_safe' => ['html']]), | ||
]; | ||
} | ||
|
||
|