src/Kunstmaan/MenuBundle/Twig/MenuTwigExtension.php
public function getMenu(\Twig_Environment $environment, $name, $lang, $options = array())
    {
        $options = array_merge($this->getDefaultOptions(), $options);

        $renderService = $this->renderService;
        $options['nodeDecorator'] = function ($node) use ($environment, $renderService, $options) {
            return $renderService->renderMenuItemTemplate($environment, $node, $options);
        };

        $arrayResult = $this->getMenuItems($name, $lang);
        $html = $this->repository->buildTree($arrayResult, $options);

        return $html;
    }
public function getMenu(\Twig_Environment $environment, $name, $lang, $options = array())
    {
        $options = array_merge($this->getDefaultOptions(), $options);

        $renderService = $this->renderService;
        $options['nodeDecorator'] = function ($node) use ($environment, $renderService, $options) {
            return $renderService->renderMenuItemTemplate($environment, $node, $options);
        };

        $arrayResult = $this->getMenuItems($name, $lang);
        $html = $this->repository->buildTree($arrayResult, $options);

        return $html;
    }
public function getMenu ( \ Twig_Environment $ environment , $ name , $ lang , $ options = array ( ) ) { $ options = array_merge ( $ this -> getDefaultOptions ( ) , $ options ) ; $ renderService = $ this -> renderService ; $ options [ 'nodeDecorator' ] = function ( $ node ) use ( $ environment , $ renderService , $ options ) { return $ renderService -> renderMenuItemTemplate ( $ environment , $ node , $ options ) ; } ; $ arrayResult = $ this -> getMenuItems ( $ name , $ lang ) ; $ html = $ this -> repository -> buildTree ( $ arrayResult , $ options ) ; return $ html ; }
Get a html representation of a menu.

@param string $name
@param string $lang
@param array  $options

@return string
Get a html representation of a menu .