function FilterPluginBase::getCacheContexts
Same name in other branches
- 8.9.x core/modules/views/src/Plugin/views/filter/FilterPluginBase.php \Drupal\views\Plugin\views\filter\FilterPluginBase::getCacheContexts()
- 10 core/modules/views/src/Plugin/views/filter/FilterPluginBase.php \Drupal\views\Plugin\views\filter\FilterPluginBase::getCacheContexts()
- 11.x core/modules/views/src/Plugin/views/filter/FilterPluginBase.php \Drupal\views\Plugin\views\filter\FilterPluginBase::getCacheContexts()
Overrides CacheableDependencyInterface::getCacheContexts
7 calls to FilterPluginBase::getCacheContexts()
- Access::getCacheContexts in core/
modules/ node/ src/ Plugin/ views/ filter/ Access.php - The cache contexts associated with this object.
- Current::getCacheContexts in core/
modules/ user/ src/ Plugin/ views/ filter/ Current.php - The cache contexts associated with this object.
- ModerationStateFilter::getCacheContexts in core/
modules/ content_moderation/ src/ Plugin/ views/ filter/ ModerationStateFilter.php - The cache contexts associated with this object.
- Status::getCacheContexts in core/
modules/ media/ src/ Plugin/ views/ filter/ Status.php - The cache contexts associated with this object.
- Status::getCacheContexts in core/
modules/ node/ src/ Plugin/ views/ filter/ Status.php - The cache contexts associated with this object.
7 methods override FilterPluginBase::getCacheContexts()
- Access::getCacheContexts in core/
modules/ node/ src/ Plugin/ views/ filter/ Access.php - The cache contexts associated with this object.
- Current::getCacheContexts in core/
modules/ user/ src/ Plugin/ views/ filter/ Current.php - The cache contexts associated with this object.
- ModerationStateFilter::getCacheContexts in core/
modules/ content_moderation/ src/ Plugin/ views/ filter/ ModerationStateFilter.php - The cache contexts associated with this object.
- Status::getCacheContexts in core/
modules/ media/ src/ Plugin/ views/ filter/ Status.php - The cache contexts associated with this object.
- Status::getCacheContexts in core/
modules/ node/ src/ Plugin/ views/ filter/ Status.php - The cache contexts associated with this object.
File
-
core/
modules/ views/ src/ Plugin/ views/ filter/ FilterPluginBase.php, line 1645
Class
- FilterPluginBase
- Base class for Views filters handler plugins.
Namespace
Drupal\views\Plugin\views\filterCode
public function getCacheContexts() {
$cache_contexts = [];
// An exposed filter allows the user to change a view's filters. They accept
// input from GET parameters, which are part of the URL. Hence a view with
// an exposed filter is cacheable per URL.
if ($this->isExposed()) {
$cache_contexts[] = 'url';
}
return $cache_contexts;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.