You are here

public function Generator::pager in Style Guide 8

Same name and namespace in other branches
  1. 2.x src/Generator.php \Drupal\styleguide\Generator::pager()

Simulate Drupal pagination,.

Parameters

int $size: The number of page numbers to display.

int $total: The total number of pages to simulate.

Return value

array A Drupal pager HTML element.

Overrides GeneratorInterface::pager

File

src/Generator.php, line 206

Class

Generator
Class Generator.

Namespace

Drupal\styleguide

Code

public function pager($size = 8, $total = 20) {
  $this->pagerManager
    ->createPager($total, $size)
    ->getCurrentPage();
  return [
    '#type' => 'pager',
  ];
}