I wrote the following code in index.php
$di->set('cache', function(){
$front = new Phalcon\Cache\Frontend\Data([]);
$cache = new Phalcon\Cache\Backend\Apc($front, []);
return $cache;
});
How I can use cache to get/save data from static methods in Models?
$di = \Phalcon\DI::getDefault();
if ($di->cache->exists("cache-key")) {
return $di->cache->get("cache-key");
} else {
Looks like I can not get the proper value using the code above. Thanks.