Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/litto/pagination

Pagination for PHP project
https://github.com/litto/pagination

Last synced: about 2 months ago
JSON representation

Pagination for PHP project

Awesome Lists containing this project

README

        

# Pagination Library
Pagination for PHP project

## How to Install?

You can install it via composer by typing:-

composer require litto/pagination:v1.0

## How it Works?

After fetching records, Pass values through this
getPages($current,$cnt,$limit);
$first = $pg->getFirst($cnt,$limit);
$last = $pg->getLast($cnt,$limit);
$prev = $pg->getPrev($current,$cnt,$limit);
$next = $pg->getNext($current,$cnt,$limit);

?>

Here $totalRecords signifies total records count
$limit the limit count of trecords to display
After passing these values to Pages Function, this class will auto assign pages, first, last, prev next varibles which enable pagination to function

And in Page links Just put like:-

####

Now your paginations Links are generated