Just checked:
$this->getFrontController()->getParam('bootstrap')->getResource('foo')
doesn't work under test either.


Ivan Krechetov wrote:
> 
> When testing with a Zend_Test_PHPUnit_ControllerTestCase, this results in:
> 
> PHP Fatal error: Call to a member function getResource() on a non-object
> in .../application/controllers/IndexController.php on line 12
> 
> Even though it works in production mode (when browsing to the
> corresponding Web page). Until introducing that getInvokeArg thing, the
> tests ran just fine.
> 
> 
> 
> Matthew Weier O'Phinney-3 wrote:
>> 
>> 
>> Within your controller, yes, there's an easier way:
>> 
>>     $this->getInvokeArg('bootstrap')->getResource('db');
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-get-an-application-resource-inside-a-controller-action-tp23728917p24806194.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to