/** * @param mixed $element * @param string $href * @return \Ajax\bootstrap\html\HtmlLink */ public function addElement($element, $href = "", $glyph = NULL) { $size = sizeof($this->content); if (is_array($element)) { $elm = new HtmlLink("lnk-" . $this->identifier . "-" . $size); $elm->fromArray($element); } else { if ($element instanceof HtmlLink) { $elm = $element; } else { $elm = new HtmlLink("lnk-" . $this->identifier . "-" . $size, $href, $element); if (isset($glyph)) { $elm->wrapContentWithGlyph($glyph); } } } $elm->wrap("<li>", "</li>"); $this->content[] = $elm; $elm->setProperty($this->attr, $this->getHref($size)); return $elm; }