public function NiceMenusBlock::getCacheTags in Nice Menus 8
The cache tags associated with this object.
When this object is modified, these cache tags will be invalidated.
Return value
string[] A set of cache tags.
Overrides ContextAwarePluginBase::getCacheTags
File
- src/
Plugin/ Block/ NiceMenusBlock.php, line 222
Class
- NiceMenusBlock
- Provides a 'Nice menus' block.
Namespace
Drupal\nice_menus\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();
$block_config = $this
->getBlockConfigExtended();
$cache_tags[] = 'config:system.menu.' . $block_config['menu_name'];
return $cache_tags;
}