コード例 #1
0
ファイル: WalkthroughSidebar.php プロジェクト: qubes/support
 /**
  * @return string
  */
 public function render()
 {
     $menu = new Nav(Nav::NAV_DEFAULT);
     $walkthrough = $this->getWalkthrough();
     foreach ($walkthrough->getSteps() as $step) {
         $state = NavItem::STATE_NONE;
         $item = new NavItem(sprintf('<a href="%s">%s</a>', $this->getUrl($step), $step->title), $state);
         $menu->addItem($item);
     }
     return $menu->render();
 }
コード例 #2
0
ファイル: CategorySidebar.php プロジェクト: qubes/support
 /**
  * @return string
  */
 public function render()
 {
     $currentCategory = $this->getCategory();
     $menu = new Nav(Nav::NAV_DEFAULT);
     foreach ($currentCategory->getSiblingCategories() as $category) {
         if ($category->id() == $currentCategory->id()) {
             $state = NavItem::STATE_ACTIVE;
         } else {
             $state = NavItem::STATE_NONE;
         }
         $item = new NavItem(sprintf('<a href="%s">%s</a>', $this->getUrl($category), $category->title), $state);
         $item->setAttribute('id', sprintf('sidebar-category-%d', $category->id()));
         $menu->addItem($item);
     }
     return $menu->render();
 }