/** * Render the menu. * * @return string */ public function render() : string { $contents = HtmlElement::render('ul', $this->htmlAttributes->toArray(), Arr::map($this->items, function (Item $item) { return HtmlElement::render($item->isActive() ? "li.{$this->activeClass}" : 'li', $item instanceof HasParentAttributes ? $item->parentAttributes() : [], $item->render()); })); $menu = "{$this->prepend}{$contents}{$this->append}"; if (!empty($this->wrap)) { return HtmlElement::render($this->wrap[0], $this->wrap[1], $menu); } return $menu; }
function el(string $tag, $attributes = null, $contents = null) : string { return \Spatie\HtmlElement\HtmlElement::render($tag, $attributes, $contents); }
/** * @return string */ public function render() : string { return HtmlElement::render("a[href={$this->url()}]", $this->htmlAttributes->toArray(), $this->text); }