} /**
* {@inheritdoc}
*/
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;
} /**
* {@inheritdoc}
*/
public function getCacheContexts() { // ::build() uses MenuLinkTreeInterface::getCurrentRouteMenuTreeParameters()
// to generate menu tree parameters, and those take the active menu trail
// into account. Therefore, we must vary the rendered menu by the active