在thinkphp中我设置了分页的格式,(上一页,下一页等)但是为什么还是这样显示原来的
functionindex(){//导入分页类import("ORG.Util.Page");$news=M('news');$count=$news->count();...
function index(){
//导入分页类
import("ORG.Util.Page");
$news = M('news');
$count = $news->count();
//print_r($count);
$page = new Page($count,8);
$list = $news->order('sort desc')->limit($page->firstRow.','.$page->listRows)->select();
// 设置分页显示
$page->setConfig('prev','上一页');
$page->setConfig('next','下一页');
$page->setConfig('first','首页');
$page->setConfig('last','末页');
$show = $page->show();
$this->assign('page',$show);
$this->assign('list',$list);
$this->display();
} 展开
//导入分页类
import("ORG.Util.Page");
$news = M('news');
$count = $news->count();
//print_r($count);
$page = new Page($count,8);
$list = $news->order('sort desc')->limit($page->firstRow.','.$page->listRows)->select();
// 设置分页显示
$page->setConfig('prev','上一页');
$page->setConfig('next','下一页');
$page->setConfig('first','首页');
$page->setConfig('last','末页');
$show = $page->show();
$this->assign('page',$show);
$this->assign('list',$list);
$this->display();
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询