本文整理汇总了PHP中Drupal\Core\Block\BlockBase::getCacheTags方法的典型用法代码示例。如果您正苦于以下问题:PHP BlockBase::getCacheTags方法的具体用法?PHP BlockBase::getCacheTags怎么用?PHP BlockBase::getCacheTags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drupal\Core\Block\BlockBase
的用法示例。
在下文中一共展示了BlockBase::getCacheTags方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCacheTags
/**
* {@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;
}
示例2: getCacheTags
/**
* {@inheritdoc}
*/
public function getCacheTags()
{
return Cache::mergeTags(parent::getCacheTags(), $this->configFactory->get('system.site')->getCacheTags());
}
示例3: getCacheTags
/**
* {@inheritdoc}
*/
public function getCacheTags()
{
// The theme-specific cache tag is set automatically for each block, but the
// output of this block also depends on the global theme settings.
$cache_tags = parent::getCacheTags();
$cache_tags[] = 'theme_global_setting';
return $cache_tags;
}
示例4: getCacheTags
/**
* {@inheritdoc}
*/
public function getCacheTags()
{
$cache_tags = parent::getCacheTags();
$feed = $this->feedStorage->load($this->configuration['feed']);
return Cache::mergeTags($cache_tags, $feed->getCacheTags());
}
示例5: getCacheTags
/**
* {@inheritdoc}
*/
public function getCacheTags()
{
return Cache::mergeTags(parent::getCacheTags(), ['node_list']);
}
示例6: getCacheTags
/**
* {@inheritdoc}
*/
public function getCacheTags()
{
// @todo: This is a temporary workaround for the lack of og cache
// contexts/tags. Remove this when Og provides proper cache context and
// instead add the proper context to the getCacheContexts method.
// @see: https://webgate.ec.europa.eu/CITnet/jira/browse/ISAICP-2628
return Cache::mergeContexts(parent::getCacheTags(), ['user.roles']);
}
示例7: getCacheTags
/**
* Implements \Drupal\Core\Entity\Entity::getCacheTags().
*/
public function getCacheTags()
{
if ($node = $this->routeMatch->getParameter('node')) {
$cache_tags = Cache::mergeTags($node->getCacheTags(), ['node_list']);
return Cache::mergeTags(parent::getCacheTags(), $cache_tags);
} else {
return parent::getCacheTags();
}
}
示例8: getCacheTags
/**
* {@inheritdoc}
*/
public function getCacheTags()
{
$parent_tags = parent::getCacheTags();
return Cache::mergeTags($parent_tags, $this->ivwTracker->getCacheTags());
}