function LocalTaskDefault::getCacheContexts

Same name in other branches
  1. 9 core/lib/Drupal/Core/Menu/LocalTaskDefault.php \Drupal\Core\Menu\LocalTaskDefault::getCacheContexts()
  2. 10 core/lib/Drupal/Core/Menu/LocalTaskDefault.php \Drupal\Core\Menu\LocalTaskDefault::getCacheContexts()
  3. 11.x core/lib/Drupal/Core/Menu/LocalTaskDefault.php \Drupal\Core\Menu\LocalTaskDefault::getCacheContexts()

Overrides CacheableDependencyInterface::getCacheContexts

File

core/lib/Drupal/Core/Menu/LocalTaskDefault.php, line 158

Class

LocalTaskDefault
Default object used for LocalTaskPlugins.

Namespace

Drupal\Core\Menu

Code

public function getCacheContexts() {
    if (!isset($this->pluginDefinition['cache_contexts'])) {
        return [];
    }
    return $this->pluginDefinition['cache_contexts'];
}

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