function PagerManager::createPager

Same name in other branches
  1. 9 core/lib/Drupal/Core/Pager/PagerManager.php \Drupal\Core\Pager\PagerManager::createPager()
  2. 8.9.x core/lib/Drupal/Core/Pager/PagerManager.php \Drupal\Core\Pager\PagerManager::createPager()
  3. 10 core/lib/Drupal/Core/Pager/PagerManager.php \Drupal\Core\Pager\PagerManager::createPager()

Overrides PagerManagerInterface::createPager

File

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

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.