Skip to content
/ pager Public

A library to split results into multiple pages

License

Notifications You must be signed in to change notification settings

Gavrysh/pager

Repository files navigation

GSPager

![Software License](https://img.shields.io/badge/license-MIT- brightgreen.svg?style=flat-square) A library to split results into multiple pages

Install

Via Composer

$ composer require Gavrysh/pager

Usage

$obj = new GSPager\DirPager(
new GSPager\PagesList(),
'photos',
3,
2);
echo "<pre>";
print_r($obj->getItems());
echo "</pre>";
echo "<p>$obj</p>";
$obj = new GSPager\FilePager(
new GSPager\ItemsRange(),
'largetextfile.txt');
echo "<pre>";
print_r($obj->getItems());
echo "</pre>";
echo "<p>$obj</p>";
try {
$pdo = new PDO(
'mysql:host=localhost;dbname=test',
'root',
'',
[PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]);
$obj = new ISPager\PdoPager(
new ISPager\ItemsRange(),
$pdo,
'table_name');
echo "<pre>";
print_r($obj->getItems());
echo "</pre>";
echo "<p>$obj</p>";
}
catch (PDOException $e) {
echo "Can't connect to database";
}

License

The MIT License (MIT). Please see [License File](https://github.com/dnoegel/ php-xdg-base-dir/blob/master/LICENSE) for more information.

About

A library to split results into multiple pages

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages