Пример #1
0
 /**
  * Returns an array of "local" pages given a page number and range.
  *
  * @param  \Paginator\Paginator $paginator
  * @param  int $pageRange Unused
  * @return array
  */
 public function getPages(Paginator $paginator, $pageRange = null)
 {
     $pageRange = $paginator->getPageRange();
     $pageNumber = $paginator->getCurrentPageNumber();
     $delta = $pageNumber % $pageRange;
     if ($delta == 0) {
         $delta = $pageRange;
     }
     $offset = $pageNumber - $delta;
     $lowerBound = $offset + 1;
     $upperBound = $offset + $pageRange;
     return $paginator->getPagesInRange($lowerBound, $upperBound);
 }
Пример #2
0
 /**
  * Returns an array of all pages given a page number and range.
  *
  * @param  \Paginator\Paginator $paginator
  * @param  int $pageRange Unused
  * @return array
  */
 public function getPages(Paginator $paginator, $pageRange = null)
 {
     return $paginator->getPagesInRange(1, $paginator->count());
 }