You are here

public function HorizontalMenu::getCacheTags in Responsive and off-canvas menu 4.4.x

Same name and namespace in other branches
  1. 8.3 src/Plugin/Block/HorizontalMenu.php \Drupal\responsive_menu\Plugin\Block\HorizontalMenu::getCacheTags()
  2. 8.2 src/Plugin/Block/HorizontalMenu.php \Drupal\responsive_menu\Plugin\Block\HorizontalMenu::getCacheTags()
  3. 4.0.x src/Plugin/Block/HorizontalMenu.php \Drupal\responsive_menu\Plugin\Block\HorizontalMenu::getCacheTags()
  4. 4.1.x src/Plugin/Block/HorizontalMenu.php \Drupal\responsive_menu\Plugin\Block\HorizontalMenu::getCacheTags()
  5. 4.3.x src/Plugin/Block/HorizontalMenu.php \Drupal\responsive_menu\Plugin\Block\HorizontalMenu::getCacheTags()

Overrides ContextAwarePluginTrait::getCacheTags

File

src/Plugin/Block/HorizontalMenu.php, line 165

Class

HorizontalMenu
Provides the HorizontalMenu block.

Namespace

Drupal\responsive_menu\Plugin\Block

Code

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:block.block.horizontalmenu';
  $cache_tags[] = 'horizontal_menu';
  return $cache_tags;
}