Skip to content

Latest commit

 

History

History
49 lines (37 loc) · 1.48 KB

readme.md

File metadata and controls

49 lines (37 loc) · 1.48 KB

Anekdotes Pagination

Latest Stable Version Build Status StyleCI License Total Downloads Codacy Badge

Utility to generate an intelligent "range" of links based on the current page and total pages.

Installation

Install via composer into your project:

composer require anekdotes/pagination

Basic Usage

Instantiate the class and use the pager method with a few parameters.

  • $pages: total number of pages

  • $current: current page

  • $length (optional): how many page to display

use Anekdotes\Pagination\Pagination;

$pagination = new Pagination();
var_dump($pagination->pager(10, 1));
/*
array(6) {
  [0]=>
  int(1)
  [1]=>
  int(2)
  [2]=>
  int(3)
  [3]=>
  int(4)
  [4]=>
  int(5)
  [5]=>
  int(6)
}
*/