如何给列表页加 动态缓存

浏览:675 发布日期:2014/02/25 分类:求助交流 关键字: 缓存
如何给列表页加 动态缓存


Public function index() {
import('ORG.Util.Page');
$count = M('Blog')->count();
$page = new Page($count, 10);
$limit = $page->firstRow . ',' . $page->listRows;
$blog = M('Blog')->limit($limit)->select();
$this->blog = $blog;
$this->page = $page->show();
$this->display();
}




安此种方法 只能缓存一个页面
Public function index() {
import('ORG.Util.Page');
$count = M('Blog')->count();
$page = new Page($count, 10);
$limit = $page->firstRow . ',' . $page->listRows;

if(!$blog = S('Journal_list')){
$blog = M('Blog')->limit($limit)->select();
$this->blog = $blog;
S('Journal_list', $blog, 60);
}

$this->page = $page->show();
$this->display();
}





新手求助...............................................


..
最佳答案
评论( 相关
后面还有条评论,点击查看>>