thinkphp 分页 为何老是没有index。php 路径完全不对

浏览:1225 发布日期:2016/01/18 分类:求助交流
PHP版本
    public  function newslist($catid){
        $db = M("content");
        $count = $db->where('catid='.$catid)->count();
        $pagecount = 1;
        $page = new \Think\Page($count , $pagecount);
        $page->parameter = $row; 
        $page->setConfig('first','首页');
        $page->setConfig('prev','上一页');
        $page->setConfig('next','下一页');
        $page->setConfig('last','尾页');
        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
        $show = $page->show();
        $list = $db->where('catid='.$catid)->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
        $this->assign('list',$list);
        $this->assign('page',$show);
        $this->display();
    }
错误路径

http://localhost:801/Backstage/Body/newslist/p/1

正确路径

http://localhost:801/index.php/Backstage/Body/newslist/catid/1/p/2
最佳答案
评论() 相关
后面还有条评论,点击查看>>