i wonder how do i get any bootstrap resource from anywhere in the application. eg. Zend_Validate, Zend_Auth_Adapter etc?
A:
Have a look at this: http://weierophinney.net/matthew/archives/235-A-Simple-Resource-Injector-for-ZF-Action-Controllers.html
That will make it easy passing it to the controller. From the controller you can then pass individual resources to the other things you need.
Daniel Egeberg
2010-07-24 14:37:24
that will give u access to ur resources from the controller right? what if i want to get them in my `Zend_Validate` or `Auth` classes?
jiewmeng
2010-07-24 14:52:57
+2
A:
$bootstrap = Zend_Controller_Front::getInstance()->getParam('bootstrap');
$resource = $bootstrap->getResource('whatEver')
ArneRie
2010-07-25 07:16:55