PHP code example of thingston / paginator
1. Go to this page and download the library: Download thingston/paginator library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
thingston / paginator example snippets
use Thingston\Paginator\Adapter\ArrayAdapter;
use Thingston\Paginator\Paginator;
$adapter = new ArrayAdapter([...]);
$paginator = new Paginator($adapter);
$paginator->setItemsPerPage(50)->setCurrentPage(2);
foreach ($paginator as $item) {
// print item details
}