function RefinableCacheableDependencyInterface::addCacheContexts

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Cache/RefinableCacheableDependencyInterface.php \Drupal\Core\Cache\RefinableCacheableDependencyInterface::addCacheContexts()
  2. 10 core/lib/Drupal/Core/Cache/RefinableCacheableDependencyInterface.php \Drupal\Core\Cache\RefinableCacheableDependencyInterface::addCacheContexts()
  3. 11.x core/lib/Drupal/Core/Cache/RefinableCacheableDependencyInterface.php \Drupal\Core\Cache\RefinableCacheableDependencyInterface::addCacheContexts()

Adds cache contexts.

Parameters

string[] $cache_contexts: The cache contexts to be added.

Return value

$this

1 method overrides RefinableCacheableDependencyInterface::addCacheContexts()
ViewUI::addCacheContexts in core/modules/views_ui/src/ViewUI.php
Adds cache contexts.

File

core/lib/Drupal/Core/Cache/RefinableCacheableDependencyInterface.php, line 23

Class

RefinableCacheableDependencyInterface
Allows to add cacheability metadata to an object for the current runtime.

Namespace

Drupal\Core\Cache

Code

public function addCacheContexts(array $cache_contexts);

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