Completed
Push — master ( 768fc3...d528d9 )
by WEBEWEB
01:51
created

MultiLevelMenuTwigExtension   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 31
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A adminBSBMultiLevelMenuFunction() 0 3 1
A getFunctions() 0 5 1
1
<?php
2
3
/**
4
 * This file is part of the adminbsb-material-design-bundle package.
5
 *
6
 * (c) 2018 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Bundle\AdminBSBBundle\Twig\Extension\Menu;
13
14
use Twig_SimpleFunction;
15
use WBW\Bundle\BootstrapBundle\Navigation\NavigationTree;
16
17
/**
18
 * Multi level menu Twig extension.
19
 *
20
 * @author webeweb <https://github.com/webeweb/>
21
 * @package WBW\Bundle\AdminBSBBundle\Twig\Extension\Menu
22
 */
23
class MultiLevelMenuTwigExtension extends AbstractMenuTwigExtension {
24
25
    /**
26
     * Constructor.
27
     */
28
    public function __construct() {
29
        parent::__construct();
30
    }
31
32
    /**
33
     * Displays an AdminBSB multi level menu.
34
     *
35
     * @param NavigationTree $tree The tree.
36
     * @return string Returns the AdminBSB multi level menu.
37
     */
38
    public function adminBSBMultiLevelMenuFunction(NavigationTree $tree) {
39
        return $this->adminBSBMenu($tree);
40
    }
41
42
    /**
43
     * Get the Twig functions.
44
     *
45
     * @return array Returns the Twig functions.
46
     */
47
    public function getFunctions() {
48
        return [
49
            new Twig_SimpleFunction("adminBSBMultiLevelMenu", [$this, "adminBSBMultiLevelMenuFunction"], ["is_safe" => ["html"]]),
50
        ];
51
    }
52
53
}
54