8.5.x LinkGeneratorTrait.php LinkGeneratorTrait::setLinkGenerator(LinkGeneratorInterface $generator)
8.0.x LinkGeneratorTrait.php LinkGeneratorTrait::setLinkGenerator(LinkGeneratorInterface $generator)
8.1.x LinkGeneratorTrait.php LinkGeneratorTrait::setLinkGenerator(LinkGeneratorInterface $generator)
8.2.x LinkGeneratorTrait.php LinkGeneratorTrait::setLinkGenerator(LinkGeneratorInterface $generator)
8.3.x LinkGeneratorTrait.php LinkGeneratorTrait::setLinkGenerator(LinkGeneratorInterface $generator)
8.4.x LinkGeneratorTrait.php LinkGeneratorTrait::setLinkGenerator(LinkGeneratorInterface $generator)
8.6.x LinkGeneratorTrait.php LinkGeneratorTrait::setLinkGenerator(LinkGeneratorInterface $generator)

Sets the link generator service.

Parameters

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

Return value

$this

File

core/lib/Drupal/Core/Routing/LinkGeneratorTrait.php, line 69

Class

LinkGeneratorTrait
Wrapper methods for the Link Generator.

Namespace

Drupal\Core\Routing

Code

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