PHP code example of flatphp / pagination

1. Go to this page and download the library: Download flatphp/pagination 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/ */

    

flatphp / pagination example snippets


use Flatphp\Pagination\Paginator;

$page = 16;
$p = new Paginator(1506, $page);
$p->getNext();
// ...


// or specify page_size or specify page style, default sliding,others: all, elastic, jumping
// 配置每页数量,以及分页样式
$p = new Paginator(1506, $page, ['page_size' => 30, 'style' => 'jumping']);
$a = $p->toArray();
print_r($a);