23/01
2018
Wallogit.com
2017 © Pedro Peláez
The highly customizable PHP pagination class.
PHP Pagination.
The highly customizable PHP pagination class.
Tested on PHP 8.4., (*1)
Example:, (*3)
// You don't need to include or require file if you install via Composer.
require_once '../Rundiz/Pagination/Pagination.php';
$total_records = 1000;
$start = (isset($_GET['start']) ? intval($_GET['start']) : 0);
if ($start < 0) {
$start = 0;
}
$limit = 10;
$Pagination = new \Rundiz\Pagination\Pagination();
// Set options to the pagination class.
$Pagination->base_url = 'http://localhost/your-project/page.php?start=%PAGENUMBER%';// *This property must be set.
$Pagination->total_records = $total_records;// *This property must be set.
$Pagination->page_number_value = $start;// *This property must be set.
echo $Pagination->createLinks();
More example is in tests folder., (*4)
, (*5)
$Pagination->unavailable_before = 1;
$Pagination->unavailable_text = '..';
$Pagination->number_adjacent_pages = 3;
$Pagination->unavailable_after = 2;