You are here

class PagererCache in Pagerer 8

Same name and namespace in other branches
  1. 8.2 src/PagererCache.php \Drupal\pagerer\PagererCache

Cache related helpers.

Hierarchy

Expanded class hierarchy of PagererCache

File

src/PagererCache.php, line 10

Namespace

Drupal\pagerer
View 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

Namesort descending Modifiers Type Description Overrides
PagererCache::preRenderPager public static function A #pre_render callback for type #pager.