Home >Backend Development >PHP Tutorial >求助,thinkphp不能import("ORG.Util.Page"); 分页类文件!

求助,thinkphp不能import("ORG.Util.Page"); 分页类文件!

WBOY
WBOYOriginal
2016-06-23 14:38:161038browse


    public function issusPage($map)
    {                             
                    import("ORG.Util.Page");//导入分页类
                    $count = M('app_config')->count();//查询满足要求的总记录数
                    echo "-00--".$count; 
                    $Page = new Page($count,10);
                    echo "-0--".$Page; 
                    $data = M('app_config')->where($map)->limit($Page->firstRow.','.$Page->listRows)->select();        
                    //$this->assign('page',$show);//赋值分页输出
                    
                                $this->assign($_POST);
                                $this->assign("data", $data);
                                 
                                $this->display('appconfig');
                                 
          }

得到的结果是:   
-00--21
-0--
为什么得不到 $Page的值?大家帮帮忙,急啊·····


\www\ThinkPHP\Extend\Library\ORG\Util
在文件夹的这个位置是有Page.class.php文件存在的····


回复讨论(解决方案)

 $Dao = M("User");
    // 计算总数
    $count = $Dao->count();
    // 导入分页类
    import("ORG.Util.Page");
  
    
    
    // 实例化分页类
    $p = new Page($count, 10);
    // 分页显示输出
    $page = $p->show();

    // 当前页数据查询
    $list = $Dao->order('id desc')->limit($p->firstRow.','.$p->listRows)->select();

    // 赋值赋值
    $this->assign('page', $page);
    $this->assign('data', $list);

    $this->display("index");

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn