You are here

public function PagererFactory::initPagers in Pagerer 8

Initialises the pagers.

Overrides PagererFactoryInterface::initPagers

File

src/PagererFactory.php, line 20

Class

PagererFactory
Provides a factory for Pagerer pagers.

Namespace

Drupal\pagerer

Code

public function initPagers() {
  global $pager_total;
  if (!empty($pager_total) && count($pager_total) > 0) {
    $max_pager_id = 0;
    foreach ($pager_total as $id => $value) {
      $max_pager_id = $id > $max_pager_id ? $id : $max_pager_id;
    }
    for ($i = 0; $i <= $max_pager_id; $i++) {
      $this
        ->get($i);
    }
  }
}