views:

90

answers:

2

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
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
+2  A: 
$bootstrap = Zend_Controller_Front::getInstance()->getParam('bootstrap');
$resource = $bootstrap->getResource('whatEver')
ArneRie