/** * Get a html representation of a menu. * * @param string $name * @param string $lang * @param array $options * @return string */ 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; }