qwAdmin分页

php部分主要是 $page = new \Think\Page($count,3);
这部分跟thinkphp的不一样,前台就用 {$page}调用一下

//-----------------------------分页
        import('ORG.Util.Page');
        $count=$artList->count();
        $page = new \Think\Page($count,3);

        $page->setConfig('prev','上一页');
        $page->setConfig('next','下一页');
        $page->setConfig('first','首页');
        $page->setConfig('last','尾页');
        $show=$page->show();

        $list=$artList->order('aid desc')->limit($page->firstRow.','.$page->listRows)->select();
        $this->assign('list',$list);
        $this->assign('page',$show);
        $this->display();


前台调用比较简单

<div class="file_holder">
    <ul>
        <volist name="list" id="vo">
            <li>
                <a href="{:U('ArticleList/ArticleArticle?aid='.$vo['aid'])}" >
                {$vo.title}:{$vo.description}
                </a>
            </li>
        </volist>
    </ul>
    <div class="result page">{$page}</div>

</div>


随机浏览