I'm trying to cache view with cache service. When I creating the cache view service with name viewCache, all works fine, but if the name of the service is != viewCache, I got the following error:
Phalcon\DI\Exception :
Service 'viewCache' was not found in the dependency injection container
In spite of I'm registers the cache as follow:
// the service registration
$di->set('myCustomView', function(){
//Cache data for one day by default
$frontCache = new Phalcon\Cache\Frontend\Output(array(
"lifetime" => 10
));
$cache = new Phalcon\Cache\Backend\Apc($frontCache, array(
'prefix' => 'app-data'
));
return $cache;
});
// code inside controller
$this->view->cache(array(
"service" => "myCustomView",
"lifetime" => 10,
"key" => 'test')
);
What I'm missing here? Phalcon 1.3.3 + PHP 5.6.1 + FPM