Hi
I'm using native CakePHP cache methods and got excellent results in a
very little time.
I had just an annoying problem: I'm unable to cache pagination results
because I get "Undefined variable: paginator" in the views.
function index() {
$cachename='home_'.$this->getCurrentPage();
Cache::set(array('duration' => Configure::read('Cache.home')));
$videos=Cache::read($cachename);;
if ($videos===false) {
$this->paginate['contain']=array(
'Tag' => array('fields' => array('Tag.id',
'Tag.name')),
false
);
$videos=$this->paginate(null, array('Site.enabled' =>
1));
Cache::set(array('duration' =>
Configure::read('Cache.home')));
Cache::write($cachename, $videos);
}
$this->set('videos', $videos);
}
This is the code I'm using.. Cache works everywhere, this is the only
place it doesn't.
Thanks for your help
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---