/** * @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(); }
/** * @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(); }