public function PagersCacheContext::getContext
public PagersCacheContext::getContext($pager_id = NULL)
Overrides CalculatedCacheContextInterface::getContext
See also
File
- core/lib/Drupal/Core/Cache/Context/PagersCacheContext.php, line 28
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); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Cache!Context!PagersCacheContext.php/function/PagersCacheContext::getContext/8.1.x