W3cubDocs

/Drupal 8

class Link

Defines an object that holds information about a link.

Hierarchy

File

core/lib/Drupal/Core/Link.php, line 11

Namespace

Drupal\Core

Members

Name Modifiers Type Description
Link::$text protected property The text of the link.
Link::$url protected property The URL of the link.
Link::createFromRoute public static function Creates a Link object from a given route name and parameters.
Link::fromTextAndUrl public static function Creates a Link object from a given Url object.
Link::getText public function Returns the text of the link.
Link::getUrl public function Returns the URL of the link.
Link::setText public function Sets the new text of the link.
Link::setUrl public function Sets the URL of this link.
Link::toRenderable public function Returns a render array representation of the object. Overrides RenderableInterface::toRenderable
Link::toString public function Generates the HTML for this Link object.
Link::__construct public function Constructs a new Link object.
LinkGeneratorTrait::$linkGenerator protected property The link generator.
LinkGeneratorTrait::getLinkGenerator protected function Returns the link generator.
LinkGeneratorTrait::l Deprecated protected function Renders a link to a route given a route name and its parameters.
LinkGeneratorTrait::setLinkGenerator public function Sets the link generator service.

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Link.php/class/Link/8.1.x