daniil / pager
A library to split results into multiple pages
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- ext-pdo: *
This package is auto-updated.
Last update: 2025-07-11 15:47:00 UTC
README
А library to split results into multiple pages
Install
Via Composer
$ composer require daniil/pager
Usage
$obj = new ISPager\DirPager( new ISPager\PagesList(), 'photos', 3, 2 ); echo '<pre>'; print_r($obj->getItems()); echo '</pre>'; echo "<p>$obj</p>";
$obj = new ISPager\FilePager( new ISPager\ItemsRange(), 'largetextfile.txt'); echo '<pre>'; print_r($obj->getItems()); echo '</pre>'; echo "<p>$obj</p>";
try { $pdo = new РDО( 'pgsql:host=localhost;dbname=test', 'root' ); $obj = new ISPager\PdoPager( new ISPager\ItemsRange(), $pdo, 'table_name'); echo '<pre>'; print_r($obj->getItems()); echo '</pre>'; echo "<p>$obj</p>"; } catch (PDOException $е) { echo "Can't connect to database"; }
License
The MIT License (MIT). Please see License File for more information.