Esempio n. 1
0
 /**
  * @param string|HtmlElement $element
  *
  * @return $this|self
  */
 public function add($element) : self
 {
     if (is_string($element) && $element == '---') {
         $element = (new HtmlElement('<li>'))->addAttribute('role', 'separator')->addClass('divider');
     } elseif (is_string($element)) {
         $element = (new HtmlElement('<li>'))->setContent($element)->addClass('dropdown-header');
     } else {
         $element = (new HtmlContainer('<li>'))->add($element);
     }
     $this->ul->add($element);
     return $this;
 }