function Link::setLinkGenerator

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Link.php \Drupal\Core\Link::setLinkGenerator()
  2. 10 core/lib/Drupal/Core/Link.php \Drupal\Core\Link::setLinkGenerator()
  3. 11.x core/lib/Drupal/Core/Link.php \Drupal\Core\Link::setLinkGenerator()

Sets the link generator service.

Parameters

\Drupal\Core\Utility\LinkGeneratorInterface $generator: The link generator service.

Return value

$this

File

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

Class

Link
Defines an object that holds information about a link.

Namespace

Drupal\Core

Code

public function setLinkGenerator(LinkGeneratorInterface $generator) {
    $this->linkGenerator = $generator;
    return $this;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.