Пример #1
0
 /**
  * Get the evaluated contents of the specified menu container.
  *
  * @param string|null $menuName
  * @return string
  * @throws MenuNotFoundException
  */
 public function render($menuName = null)
 {
     if (empty($menuName)) {
         $menuName = self::DEFAULT_MENU_NAME;
     }
     $menu = $this->menus->filter(function (MenuContainer $menu) use($menuName) {
         return $menu->getName() == $menuName;
     })->first();
     if ($menu instanceof MenuContainer) {
         return MenuHelper::purifyHtml(Html::decode($menu->render()));
     } else {
         throw new MenuNotFoundException($menuName);
     }
 }