PHP code example of jose-chan / pager

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

    

jose-chan / pager example snippets



$page = 1;//当前页数
$size = 20;//每页行数

$count = 200;//总行数

$pager = new Pager($page, $size);

$meta = $pager->getPager($count);
//$meta = [
//  'total_count'	=>	200,
//  'page_size'	=>	20,
//  'total_page'	=>	10,
//  'first_page'	=>	1,
//  'prev_page'	=>	1,
//  'next_page'	=>	2,
//  'last_page'	=>	20,
//  'current_page'=>	1
//]