PHP code example of zyan / page

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

    

zyan / page example snippets


use Zyan\Page\Page;

$config = [
    'total_rows' => 1000, //总条数
    'url_rule' => '/list/?.html', //url规则 ? 代替分页数
    'now_page' => 50, //当前页
    'list_rows' => 10, //一页显示多少条
];

$page = Page($config);

echo $page->show();

$config = [
    'first_page_name' => '<<', //第一页
    'prev_page_name' => '<', //上一页
    'next_page_name' => '>', //下一页
    'last_page_name' => '>>', //最后一页
    //...
];

$page = Page($config);