Exemplo n.º 1
0
 public function renderMenu($renderer, array $options = array())
 {
     $menu = $this->getRoot();
     if (isset($options['path'])) {
         $menu = $this->getMenuByPath($options['path']);
         unset($options['path']);
     }
     $renderer = $this->rendererManager->getRenderer($renderer);
     $renderer->setParentControl($this);
     $result = $renderer->render($menu, $options);
     $renderer->setParentControl(null);
     echo $result;
 }
Exemplo n.º 2
0
 /**
  * @param $manager IManager
  * @param $container Container
  */
 public static function setupRenderers(IManager $manager, Container $container)
 {
     foreach ($container->findByTag(static::RENDERER_TAG_NAME) as $name => $value) {
         $manager->addRenderer($value, $container->getService($name));
     }
 }