You are here

public function CacheContexts::__construct in Render cache 7.2

Same name in this branch
  1. 7.2 src/Cache/CacheContexts.php \Drupal\render_cache\Cache\CacheContexts::__construct()
  2. 7.2 lib/Drupal/Core/Cache/CacheContexts.php \Drupal\Core\Cache\CacheContexts::__construct()

Constructs a CacheContexts object.

Parameters

\Drupal\service_container\DependencyInjection\ContainerInterface $container: The current service container.

array $contexts: An array of key-value pairs, where the keys are service names (which also serve as the corresponding cache context token) and the values are the cache context labels.

Overrides CacheContexts::__construct

File

src/Cache/CacheContexts.php, line 44
Contains \Drupal\render_cache\Cache\CacheContexts

Class

CacheContexts
Defines the CacheContexts service.

Namespace

Drupal\render_cache\Cache

Code

public function __construct(ContainerInterface $container, array $contexts) {
  $this->container = $container;
  $this->contexts = $contexts;
}