Link::setUrl

public Link::setUrl(Url $url) Sets the URL of this link. Parameters Url $url: The URL object to set Return value $this File core/lib/Drupal/Core/Link.php, line 130 Class Link Defines an object that holds information about a link. Namespace Drupal\Core Code public function setUrl(Url $url) { $this->url = $url; return $this; }

Link::setText

public Link::setText($text) Sets the new text of the link. Parameters string $text: The new text. Return value $this File core/lib/Drupal/Core/Link.php, line 108 Class Link Defines an object that holds information about a link. Namespace Drupal\Core Code public function setText($text) { $this->text = $text; return $this; }

Link::preRenderLink

public static Link::preRenderLink($element) Pre-render callback: Renders a link into #markup. Doing so during pre_render gives modules a chance to alter the link parts. Parameters array $element: A structured array whose keys form the arguments to \Drupal\Core\Utility\LinkGeneratorInterface::generate(): #title: The link text. #url: The URL info either pointing to a route or a non routed path. #options: (optional) An array of options to pass to the link generator. Return value array The p

Link::getUrl

public Link::getUrl() Returns the URL of the link. Return value \Drupal\Core\Url File core/lib/Drupal/Core/Link.php, line 118 Class Link Defines an object that holds information about a link. Namespace Drupal\Core Code public function getUrl() { return $this->url; }

Link::getText

public Link::getText() Returns the text of the link. Return value string File core/lib/Drupal/Core/Link.php, line 96 Class Link Defines an object that holds information about a link. Namespace Drupal\Core Code public function getText() { return $this->text; }

Link::getInfo

public Link::getInfo() Returns the element properties for this element. Return value array An array of element properties. See \Drupal\Core\Render\ElementInfoManagerInterface::getInfo() for documentation of the standard properties of all elements, and the return value format. Overrides ElementInterface::getInfo File core/lib/Drupal/Core/Render/Element/Link.php, line 34 Class Link Provides a link render element. Namespace Drupal\Core\Render\Element Code public function getInfo() { $c

Link::fromTextAndUrl

public static Link::fromTextAndUrl($text, Url $url) Creates a Link object from a given Url object. Parameters string $text: The text of the link. \Drupal\Core\Url $url: The Url to create the link for. Return value static File core/lib/Drupal/Core/Link.php, line 87 Class Link Defines an object that holds information about a link. Namespace Drupal\Core Code public static function fromTextAndUrl($text, Url $url) { return new static($text, $url); }

Link::createFromRoute

public static Link::createFromRoute($text, $route_name, $route_parameters = array(), $options = array()) Creates a Link object from a given route name and parameters. Parameters string $text: The text of the link. string $route_name: The name of the route array $route_parameters: (optional) An associative array of parameter names and values. array $options: (optional) An associative array of additional options, with the following elements: 'query': An array of query key/value-pairs (without a

Link::$url

The URL of the link. Type: \Drupal\Core\Url File core/lib/Drupal/Core/Link.php, line 30 Class Link Defines an object that holds information about a link. Namespace Drupal\Core Code protected $url;

Link::$text

The text of the link. Type: string File core/lib/Drupal/Core/Link.php, line 23 Class Link Defines an object that holds information about a link. Namespace Drupal\Core Code protected $text;