function UrlGeneratorTrait::setUrlGenerator

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;
}

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