public function PagersCacheContext::getContext in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Core/Cache/Context/PagersCacheContext.php \Drupal\Core\Cache\Context\PagersCacheContext::getContext()
Overrides CalculatedCacheContextInterface::getContext
See also
File
- core/
lib/ Drupal/ Core/ Cache/ Context/ PagersCacheContext.php, line 33 - Contains \Drupal\Core\Cache\Context\PagersCacheContext.
Class
- PagersCacheContext
- Defines a cache context for "per page in a pager" caching.
Namespace
Drupal\Core\Cache\ContextCode
public function getContext($pager_id = NULL) {
// The value of the 'page' query argument contains the information that
// controls *all* pagers.
if ($pager_id === NULL) {
return $this->requestStack
->getCurrentRequest()->query
->get('page', '');
}
return $pager_id . '.' . pager_find_page($pager_id);
}