public static Pager::preRenderPager(array $pager)
#pre_render callback to associate the appropriate cache context.
Parameters
array $pager: A renderable array of #type => pager.
Return value
array
File
- core/lib/Drupal/Core/Render/Element/Pager.php, line 69
Class
- Pager
- Provides a render element for a pager.
Namespace
Drupal\Core\Render\Element
Code
public static function preRenderPager(array $pager) { // Note: the default pager theme process function // template_preprocess_pager() also calls pager_query_add_page(), which // maintains the existing query string. Therefore // template_preprocess_pager() adds the 'url.query_args' cache context, // which causes the more specific cache context below to be optimized away. // In other themes, however, that may not be the case. $pager['#cache']['contexts'][] = 'url.query_args.pagers:' . $pager['#element']; return $pager; }
Please login to continue.