1. Go to this page and download the library: Download wake/pager 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/ */
wake / pager example snippets
Use Pager\Pager;
$pager = new Pager ();
$pager->total (1000) // 1000 data items
->page (13) // Set current page to no.13
->paging ();
// First page: 1
echo $pager->pages->top;
// Last page (total pages): 67
echo $pager->pages->end;
// First page of page group: 8
echo $page->pages->first;
// Last page of page group: 17
echo $page->pages->last;
// Next page: 14
echo $page->pages->next;
// Next 10 page: 24
echo $page->pages->next10;
// Pages
foreach ($pager->pages as $page)
echo $page . "<br />";
// Page url
foreach ($pager->pages as $page)
echo $page->url . "<br />";
// Display 12 items on each page.
$pager->show (12);
// Set total amount of 100.
$pager->total (100);
// Display 5 pages of page group on each page - `1 2 3 4 5`
$pager->size (5);
Use Pager\Pager;
$pager = new Pager ();
$pager->total (1000) // 1000 data items
->page (13) // current page is no.13
->paging ();
$pages = $pager->pages;
// Next page
$pages->next;
$pages->next1;
// Next 5 page
$pages->next5;
Use Pager\Pager;
$pager = new Pager ();
$pager->total (1000) // 1000 data items
->page (13) // current page is no.13
->paging ();
$item = $pager->pages->first;
echo $item;
echo $item->num;
echo $item->url ();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.