stopsopa / paginator-test
Installs: 3
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Language:JavaScript
Requires
- php: ^7.2
Requires (Dev)
- phpunit/phpunit: v5.7
- satooshi/php-coveralls: v0.7.1
README
DEPRECATED ???
Created in 2022 - quite old now and not maintained. Butt.... Due to it's simplicity I believe it could be still used đ€·
Nothing to be ashamed here:
I used best tools available at a time and delivered what's needed quickly.
Table of Contents
(TOC generated using markdown-toc)
Installation
composer require stopsopa/paginator-test
Usage
<?php use Stopsopa\PaginatorTest\Paginator; require_once dirname(__FILE__).'/vendor/autoload.php'; $list = str_split('abcdefghijklmnopqrstuwxyz', 1); $paginator = new Paginator( 3, // per page // function to return length of the set function () use ($list) { return count($list); }, // function to provide one page of elements from set function ($offset, $limit) use ($list) { return array_slice($list, $offset, $limit); }, 3 // how many buttons around current ); $page = $paginator->getPage(3); var_dump($page->elements()); //array(3) { // [0] => string(1) "g" // [1] => string(1) "h" // [2] => string(1) "i" //} var_dump($page->pages()); //array(3) { // [0] => array(2) { // 'page' => int(2) // 'current' => bool(false) // } // [1] => array(2) { // 'page' => int(3) // 'current' => bool(true) // } // [2] => array(2) { // 'page' => int(4) // 'current' => bool(false) // } //}
see more: test
Dev notes
Just follow Makefile... it should be quite self explanatory