1 | <?php |
||
8 | class MenuExtension extends \Twig_Extension |
||
9 | { |
||
10 | /** |
||
11 | * @var Helper |
||
12 | */ |
||
13 | private $helper; |
||
14 | /** |
||
15 | * @var MatcherInterface |
||
16 | */ |
||
17 | private $matcher; |
||
18 | |||
19 | /** |
||
20 | * @param Helper $helper |
||
21 | * @param MatcherInterface $matcher |
||
22 | */ |
||
23 | public function __construct(Helper $helper, MatcherInterface $matcher) |
||
28 | |||
29 | /** |
||
30 | * @return array |
||
31 | */ |
||
32 | public function getFunctions() |
||
38 | |||
39 | /** |
||
40 | * Retrieves the current item. |
||
41 | * |
||
42 | * @param ItemInterface|string $menu |
||
43 | * |
||
44 | * @return ItemInterface |
||
45 | */ |
||
46 | public function getCurrentItem($menu) |
||
56 | |||
57 | /** |
||
58 | * @param ItemInterface $item |
||
59 | * |
||
60 | * @return ItemInterface|null |
||
61 | */ |
||
62 | private function retrieveCurrentItem(ItemInterface $item) |
||
79 | |||
80 | /** |
||
81 | * @return string |
||
82 | */ |
||
83 | public function getName() |
||
87 | } |