function RequestStackCacheContextBase::__construct

Same name in other branches
  1. 9 core/lib/Drupal/Core/Cache/Context/RequestStackCacheContextBase.php \Drupal\Core\Cache\Context\RequestStackCacheContextBase::__construct()
  2. 8.9.x core/lib/Drupal/Core/Cache/Context/RequestStackCacheContextBase.php \Drupal\Core\Cache\Context\RequestStackCacheContextBase::__construct()
  3. 10 core/lib/Drupal/Core/Cache/Context/RequestStackCacheContextBase.php \Drupal\Core\Cache\Context\RequestStackCacheContextBase::__construct()

Constructs a new RequestStackCacheContextBase class.

Parameters

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

File

core/lib/Drupal/Core/Cache/Context/RequestStackCacheContextBase.php, line 29

Class

RequestStackCacheContextBase
Defines a base class for cache contexts depending only on the request stack.

Namespace

Drupal\Core\Cache\Context

Code

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

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