public function TocJsBlock::getCacheTags in Toc.js 2.0.x
Same name and namespace in other branches
- 8 src/Plugin/Block/TocJsBlock.php \Drupal\toc_js\Plugin\Block\TocJsBlock::getCacheTags()
Overrides ContextAwarePluginTrait::getCacheTags
File
- src/
Plugin/ Block/ TocJsBlock.php, line 330
Class
- TocJsBlock
- Provides a 'SocialSimpleBlock' block.
Namespace
Drupal\toc_js\Plugin\BlockCode
public function getCacheTags() {
/** @var \Drupal\node\NodeInterface $node */
if ($node = $this->currentRouteMatch
->getParameter('node')) {
return Cache::mergeTags(parent::getCacheTags(), $node
->getCacheTags());
}
elseif ($taxonomy_term = $this->currentRouteMatch
->getParameter('taxonomy_term')) {
return Cache::mergeTags(parent::getCacheTags(), $taxonomy_term
->getCacheTags());
}
else {
return parent::getCacheTags();
}
}