onethink 里面的代码我分析了下 发现
Application\Admin\Controller\ArticleController.class.php上面这个文件的 index 方法是有分页效果的,里面的 use COM\Page; 这个东东就是调用think 框架内部的对么?
我不想用系统自带的分页类,
我把自己写的分页类放到了下面这里
\Application\Common\Controller\Page.class.php之后我在 Application\Admin\Controller\IndexController.class.php 里面有分页需求请问我如何调用呢?
之前的使用方法如下
public function index() {
$where['status'] = array('eq', 1);
import('Common.Page', APP_PATH); // 导入分页类
$count = $this->DB->where($where)->count(); // 获取数量
$Page = new Page($count, 10); // 实例化分页类 传入总记录数和每页显示的记录数
$show = $Page->show(); // 分页显示输出
$list = $this->DB->where($where)->limit($Page->firstRow . ',' . $Page->listRows)->order('oid ASC')->select();
$this->assign('list', $list); // 赋值数据集
$this->assign('page', $show); // 赋值分页输出
$this->assign('nav_active_index', 'active');
$this->assign('title', '列表');
$this->display();
}换成onethink里面的写法后 不晓得咋写了寻求帮忙 谢谢
最佳答案