# 闲话少许直接上代码
$curpage = input('page') ? input('page') : 1;//当前第x页,有效值为:1,2,3,4,5...
$listRow =30;//每页2行记录
$showdata = array_chunk($res[$curpage-1], count($res[0]), true);
$p = Bootstrap::make($showdata, $listRow, $curpage, count($res), false, [
'var_page' => 'page',
'path' => url('/admin/Inventory/lists'),//这里根据需要修改url
'query' => [],
'fragment' => '',
]);
$p->appends($_GET);
//dump($p);
// dump($p->render());exit;
$this->assign('plist', $p);
$this->assign('plistpage', $p->render());
html页面直接
{$plistpage}这样就可以了
需要引入的css
![](https://box.kancloud.cn/2e07595dbf854c53e7e19eed6a5ffffc_1383x99.png)!