You are here

protected function LinkGeneratorTrait::getLinkGenerator in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Routing/LinkGeneratorTrait.php \Drupal\Core\Routing\LinkGeneratorTrait::getLinkGenerator()

Returns the link generator.

Return value

\Drupal\Core\Utility\LinkGeneratorInterface The link generator

File

core/lib/Drupal/Core/Routing/LinkGeneratorTrait.php, line 51
Contains \Drupal\Core\Routing\LinkGeneratorTrait.

Class

LinkGeneratorTrait
Wrapper methods for the Link Generator.

Namespace

Drupal\Core\Routing

Code

protected function getLinkGenerator() {
  if (!isset($this->linkGenerator)) {
    $this->linkGenerator = \Drupal::service('link_generator');
  }
  return $this->linkGenerator;
}