class PagererCache in Pagerer 8
Same name and namespace in other branches
- 8.2 src/PagererCache.php \Drupal\pagerer\PagererCache
Cache related helpers.
Hierarchy
- class \Drupal\pagerer\PagererCache
Expanded class hierarchy of PagererCache
File
- src/
PagererCache.php, line 10
Namespace
Drupal\pagererView source
class PagererCache {
/**
* A #pre_render callback for type #pager.
*
* Used to associate the config:pagerer.settings cache tag to the #pager
* type, since Pagerer makes the rendered pager dependent on its
* configuration.
*
* @param array $pager
* A renderable array of #type => pager.
*
* @return array
* The altered renderable array.
*/
public static function preRenderPager(array $pager) {
CacheableMetadata::createFromRenderArray($pager)
->merge(CacheableMetadata::createFromObject(\Drupal::config('pagerer.settings')))
->applyTo($pager);
return $pager;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PagererCache:: |
public static | function | A #pre_render callback for type #pager. |