tsbgroup / simply-paginator
Paginator for your projects
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/tsbgroup/simply-paginator
Requires
- php: >=5.3.0
Requires (Dev)
- phpunit/phpunit: 4.0.*
This package is not auto-updated.
Last update: 2025-10-15 13:40:12 UTC
README
Installation:
composer require tsbgroup/simply-paginator
Use
use SimplyPaginator\Paginator
$totalItems = 50; //Total count elements for which will be build pagination
$perPage = 10; //Count elements to showing on each page
$currentPage = 1; //Number of current page
$route = '/?page='; //Part of url, which responsible for get elements for this page
$Paginator = new Paginator($totalItems, $perPage, $currentPage, $route);
//render paginate block
$Paginator->render();
/**
Return html block like this:
<ul>
<li class="active">1</li>
<li><a href="/?page=2">2</a></li>
<li><a href="/?page=3">3</a></li>
<li><a href="/?page=4">4</a></li>
<li><a href="/?page=5">5</a></li>
</ul>
*/