Exemplo n.º 1
0
 /**
  * @return HtmlContainer
  */
 public function getHeader() : HtmlContainer
 {
     $title = ($this->icon ? (new HtmlElement('<i>'))->addClass($this->icon)->render() . ' ' : '') . $this->title;
     $link = new HtmlContainer('<a>', $title);
     if ($this->href && !$this->isDisabled()) {
         $link->addAttribute('href', $this->href);
     }
     if (substr($this->href, 0, 1) == '#' && !$this->isDisabled()) {
         $link->addAttribute('data-toggle', 'tab');
     }
     $li = (new HtmlContainer('<li>'))->addAttribute('role', 'presentation')->add($link);
     if ($this->isActive()) {
         $li->addClass('active');
     }
     if ($this->isDisabled()) {
         $li->addClass('disabled');
     }
     return $li;
 }