You are here

public function UrlGeneratorTrait::setUrlGenerator in Drupal 8

Sets the URL generator service.

Parameters

\Drupal\Core\Routing\UrlGeneratorInterface $generator: The url generator service.

Return value

$this

Deprecated

in drupal:8.0.0 and is removed from drupal:9.0.0.

File

core/lib/Drupal/Core/Routing/UrlGeneratorTrait.php, line 99

Class

UrlGeneratorTrait
Wrapper methods for the Url Generator.

Namespace

Drupal\Core\Routing

Code

public function setUrlGenerator(UrlGeneratorInterface $generator) {
  @trigger_error(__NAMESPACE__ . "\\UrlGeneratorTrait::setUrlGenerator() is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. See https://www.drupal.org/node/2614344", E_USER_DEPRECATED);
  $this->urlGenerator = $generator;
  return $this;
}