gases / pager
A library to split results into multiple pages
Installs: 8
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:project
Requires
- php: >=7.0.0
This package is auto-updated.
Last update: 2025-06-07 08:50:52 UTC
README
 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.