You are here

public function TBMegaMenuBlock::getCacheTags in The Better Mega Menu 8

Same name and namespace in other branches
  1. 2.x src/Plugin/Block/TBMegaMenuBlock.php \Drupal\tb_megamenu\Plugin\Block\TBMegaMenuBlock::getCacheTags()

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/TBMegaMenuBlock.php, line 118

Class

TBMegaMenuBlock
Provides blocks which belong to TB Mega Menu.

Namespace

Drupal\tb_megamenu\Plugin\Block

Code

public function getCacheTags() {

  // Rebuild block when menu or config changes.
  $configName = "{$this->getDerivativeId()}__{$this->getThemeName()}";
  $cacheTags = parent::getCacheTags();
  $cacheTags[] = 'config:system.menu.' . $this
    ->getDerivativeId();
  $cacheTags[] = 'config:tb_megamenu.menu_config.' . $configName;
  return $cacheTags;
}