function PagerManager::createPager

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Pager/PagerManager.php \Drupal\Core\Pager\PagerManager::createPager()

File

core/lib/Drupal/Core/Pager/PagerManager.php, line 55

Class

PagerManager
Provides a manager for pagers.

Namespace

Drupal\Core\Pager

Code

public function createPager($total, $limit, $element = 0) {
  $currentPage = $this->pagerParams
    ->findPage($element);
  $pager = new Pager($total, $limit, $currentPage);
  $this->setPager($pager, $element);
  return $pager;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.