Exemplo n.º 1
0
 /**
  * Return this item rendered to HTML
  *
  * @return  string
  */
 public function render()
 {
     try {
         return $this->getRenderer()->setItem($this)->render();
     } catch (Exception $e) {
         Logger::error('Could not invoke custom navigation item renderer. %s in %s:%d with message: %s', get_class($e), $e->getFile(), $e->getLine(), $e->getMessage());
         $renderer = new NavigationItemRenderer();
         return $renderer->render($this);
     }
 }
 /**
  * Render the given navigation item as HTML anchor with a badge
  *
  * @param   NavigationItem  $item
  *
  * @return  string
  */
 public function render(NavigationItem $item = null)
 {
     if ($item === null) {
         $item = $this->getItem();
     }
     $item->setCssClass('badge-nav-item');
     $this->setEscapeLabel(false);
     $label = $this->view()->escape($item->getLabel());
     if (($icon = $item->getIcon()) !== null) {
         $label = $this->view()->icon($icon) . $label;
         $item->setIcon(null);
     }
     $item->setLabel($this->renderBadge() . $label);
     $html = parent::render($item);
     if ($icon) {
         $item->setIcon(true);
     }
     return $html;
 }
 public function render(NavigationItem $item = null)
 {
     return parent::render($item);
 }
 /**
  * {@inheritdoc}
  */
 public function render()
 {
     foreach ($this as $item) {
         /** @var NavigationItem $item */
         if ($item->shouldRender()) {
             if ($this->getUseStandardItemRenderer()) {
                 $renderer = new NavigationItemRenderer();
                 $content = $renderer->render($item);
             } else {
                 $content = $item->render();
             }
             $this->content[] = $this->getInnerIterator()->beginItemMarkup($item);
             $this->content[] = $content;
             if (!$item->hasChildren()) {
                 $this->content[] = $this->getInnerIterator()->endItemMarkup();
             }
         }
     }
     return join("\n", $this->content);
 }
 /**
  * Render the given navigation item as HTML anchor with a badge
  *
  * @param   NavigationItem  $item
  *
  * @return  string
  */
 public function render(NavigationItem $item = null)
 {
     return $this->renderBadge() . parent::render($item);
 }
 public function render(NavigationItem $item = null)
 {
     return '<div class="clearfix">' . $this->getAvatar() . parent::render($item) . '</div>';
 }