text = $text; if ($url instanceof Url) { if ($urlParams !== null) { $url->addParams($urlParams); } $link->url = $url; } else { $link->url = Url::fromPath($url, $urlParams); } $link->attributes = new Attributes($attributes); return $link; } /** * @return string */ public function getRenderedText() { return $this->view()->escape((string) $this->text); } /** * @return Url */ public function getUrl() { return $this->url; } /** * @inheritdoc */ public function render() { return sprintf( '%s', $this->getUrl(), $this->attributes->render(), $this->getRenderedText() ); } }