HEX
Server: nginx/1.28.1
System: Linux VM-0-12-opencloudos 6.6.117-45.oc9.x86_64 #1 SMP Thu Dec 4 10:26:39 CST 2025 x86_64
User: www (1000)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/www.waciwang.com/wp-content/themes/miragev-main/inc/paginator/examples/demo.php
<link href="../css/pagination.css" rel="stylesheet">
<style>
    body {
        background: #f5f5f5;
        color: #43505a;
    }

    .demo-box {
        padding: 20px;
        background: #fff;
        border-radius: 5px;
        margin-bottom: 20px;
    }

    .demo-box .title {
        margin: 10px 0;
        margin-bottom: 20px;
        font-size: 1rem;
    }

    .has-border.m-pagination .m-pagination-prev,
    .has-border.m-pagination .m-pagination-next,
    .has-border.m-pagination .m-pager-number {
        border: solid 1px #673ab7;
        background: #fff;
        color: #673ab7;
    }

    .has-border.m-pagination .m-pager-number.active {
        background: #673ab7;
        border: solid 1px #673ab7;
    }
</style>
<?php
include_once('../src/pagination.class.php');

$pageSize = abs($_GET['pageSize']);
$pageSize = $pageSize ? $pageSize : 10;

$page = new Pagination(2000, $pageSize);


$page->pagerCount = 8;
$page->prevText = '上一页';
$page->nextText = '下一页';

echo '<div class="demo-box">';
echo '<h3 class="title">完整例子</h3>';
echo $page->links();

echo '<h3 class="title">分页布局控制</h3>';
echo $page->links(['pager', 'prev', 'next', 'sizes']);

echo '<h3 class="title">简单分页</h3>';
echo $page->simpleLinks();

echo '</div>';

echo '<div class="demo-box">';
echo '<h3 class="title">自定义样式</h3>';

$page2 = new Pagination(500);

$page2->containerClassName = 'has-border';

// 多个分页同一个页面需要区分下分页参数
$page2->setQueryField([
    'page' => 'p',
    'size' => 's'
]);

$page2->setQueryParams([
    'test' => 123,
    'kw' => 'hello'
]);

echo $page2->links(['pager']);

echo '</div>';
// echo '<pre>';
// print_r($page2);