function NavigationMenuBlock::getCacheContexts

Same name in other branches
  1. 11.x core/modules/navigation/src/Plugin/Block/NavigationMenuBlock.php \Drupal\navigation\Plugin\Block\NavigationMenuBlock::getCacheContexts()

Overrides SystemMenuBlock::getCacheContexts

File

core/modules/navigation/src/Plugin/Block/NavigationMenuBlock.php, line 113

Class

NavigationMenuBlock
Provides a generic menu navigation block.

Namespace

Drupal\navigation\Plugin\Block

Code

public function getCacheContexts() : array {
    // We don't use menu active trails here.
    return array_filter(parent::getCacheContexts(), static fn(string $tag) => !str_starts_with($tag, 'route.menu_active_trails'));
}

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