function NullGenerator::__construct

Same name in other branches
  1. 9 core/lib/Drupal/Core/Routing/NullGenerator.php \Drupal\Core\Routing\NullGenerator::__construct()
  2. 8.9.x core/lib/Drupal/Core/Routing/NullGenerator.php \Drupal\Core\Routing\NullGenerator::__construct()
  3. 11.x core/lib/Drupal/Core/Routing/NullGenerator.php \Drupal\Core\Routing\NullGenerator::__construct()

Override the parent constructor.

Parameters

\Symfony\Component\HttpFoundation\RequestStack $request_stack: The request stack.

Overrides UrlGenerator::__construct

File

core/lib/Drupal/Core/Routing/NullGenerator.php, line 21

Class

NullGenerator
No-op implementation of a URL Generator, needed for backward compatibility.

Namespace

Drupal\Core\Routing

Code

public function __construct(RequestStack $request_stack) {
    $this->requestStack = $request_stack;
    $this->context = new RequestContext();
}

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