function TwigExtension::setUrlGenerator

Sets the URL generator.

Parameters

\Drupal\Core\Routing\UrlGeneratorInterface $url_generator: The URL generator.

Return value

$this

Deprecated

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

1 call to TwigExtension::setUrlGenerator()
TwigExtension::setGenerators in core/lib/Drupal/Core/Template/TwigExtension.php
Sets the URL generator.

File

core/lib/Drupal/Core/Template/TwigExtension.php, line 99

Class

TwigExtension
A class providing Drupal Twig extensions.

Namespace

Drupal\Core\Template

Code

public function setUrlGenerator(UrlGeneratorInterface $url_generator) {
    $this->urlGenerator = $url_generator;
    return $this;
}

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