示例#1
0
 /**
  * @param NavbarEntityContract $entity
  * @param array $attrs
  *
  * @return string
  */
 private function renderBootstrapLink(NavbarEntityContract $entity, $attrs = [])
 {
     $attrs['class'] = $entity->class;
     $link = Html::tag('a', $attrs, $entity->renderBody($entity->renderIcon()));
     $container_attrs['title'] = $entity->title;
     if ($this->isActive($entity)) {
         $container_attrs['class'] = $this->config->active_link_class;
     }
     return Html::tag('li', $container_attrs, $link);
 }
示例#2
0
 /**
  * Form a Navbar element object by adding Navbar entity to it and<br/>
  * fill the content if Navbar entity is an element.
  *
  * @param  NavbarEntityContract  $entity Navbar entity
  * @return NavbarElement
  */
 private function element(NavbarEntityContract $entity)
 {
     $element = new NavbarElement();
     $element->type = NavbarElement::TYPE_ENTITY;
     $element->entity = $entity;
     if ($entity->isGroup()) {
         $element->type = NavbarElement::TYPE_GROUP;
         $element->content = $this->byPid ? [] : $this->elements($entity->id);
     }
     return $element;
 }
示例#3
0
 /**
  *
  * @param NavbarEntityContract $entity
  * @param array $attrs
  * @return string
  */
 protected function renderLink(NavbarEntityContract $entity, $attrs = [])
 {
     $link = Html::tag($this->config->link_tag, $attrs, $entity->renderBody($entity->renderIcon()));
     if ($this->config->link_container_tag) {
         return $this->renderLinkContainer($entity, $link);
     }
     return $link;
 }