Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

view->cache level

in my action write:

$this->view->setRenderLevel(\Phalcon\Mvc\View::LEVEL_ACTION_VIEW);

and cache:

$this->view->cache(array("key" => 'key'));

it not cached!! if remove LEVEL_ACTION_VIEW - cached OK! how to make that cached with level??? thanks.

I think it caches whole rendered view and not its part.



368
Accepted
answer
edited Oct '14

This is corrected code

$this->view->cache(array('level' => \Phalcon\Mvc\View::LEVEL_ACTION_VIEW));


368
edited Oct '14

I think you can also use

$cache_options = array('level' => \Phalcon\Mvc\View::LEVEL_ACTION_VIEW);
$this->view->cache(array('cache'=>$cache_options));