Controller类创建方法
public function ajaxindex($p,$cid){
$articlecate=M('articlecate');
$article=M('article');
$listRows=6;
$firstRow=($p-1)*$listRows;
$data=$article->where("cateid in(".$cid.")")->limit($firstRow,$listRows)->field("id,title,pic,time,des")->select();
echo json_encode($data);
}页面js输出
上一篇:AppServ安装
下一篇:PHP系列(十三)PHP会话控制