public function SystemMenuBlock::getCacheTags in Drupal 9
Same name and namespace in other branches
- 8 core/modules/system/src/Plugin/Block/SystemMenuBlock.php \Drupal\system\Plugin\Block\SystemMenuBlock::getCacheTags()
Overrides ContextAwarePluginTrait::getCacheTags
File
- core/
modules/ system/ src/ Plugin/ Block/ SystemMenuBlock.php, line 211
Class
- SystemMenuBlock
- Provides a generic Menu block.
Namespace
Drupal\system\Plugin\BlockCode
public function getCacheTags() {
// Even when the menu block renders to the empty string for a user, we want
// the cache tag for this menu to be set: whenever the menu is changed, this
// menu block must also be re-rendered for that user, because maybe a menu
// link that is accessible for that user has been added.
$cache_tags = parent::getCacheTags();
$cache_tags[] = 'config:system.menu.' . $this
->getDerivativeId();
return $cache_tags;
}