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");