views:

343

answers:

1

hello world!
in my controller i cache some paginatedata. after refresh (f5) i get only the data from the cachequeryfile but i lost ALL other data in my view.
why?

cachingmethod: file
cakeversion: 1.2.5
codeexample:

$url="home_page_1";
if(!Cache::read($url)){
    $data = $this->paginate('Article');
    Cache::write($url, $data);
}
$data = Cache::read($url);

thanks hansi meier

A: 

Try this:

if(($data = Cache::read($url)) === false){
    $data = $this->paginate('Article');
    Cache::write($url, $data);
}
KienPham.com