As in ZF to the cache object inside the model?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
3 views
In Zend Framework you can get a reference to the object in Zend_Cache (created in bootstrap method __initCache()) from within the model, passing a reference to it in the constructor? For example, inside the controller — easy:
$bootstrap = $this->getInvokeArg( 'bootstrap' ); $cache = $bootstrap->getResource( 'Cache' );



PS: the variant with Zend_Registry does not offer.
by | 3 views

1 Answer

0 like 0 dislike
So here, you can:
\r
$cache = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('Cache');
\r

Checked on 1.11.0 dev. Works!
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
7 answers
asked Mar 23, 2019 by Dzen_Marketing
0 like 0 dislike
6 answers
asked Mar 24, 2019 by joger
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
27,858 users