I predict we will see this question every so often until the bootstrap
becomes more directly accessible, like the view.

So in a controller's action method, something like:

$this->bootstrap->db;

would be nice.

- Steve W.


Matthew Weier O'Phinney-3 wrote:
> 
> -- Vladas Diržys <vladas.dir...@gmail.com> wrote
> (on Tuesday, 26 May 2009, 09:40 PM +0300):
>> what is the right way to get a db (or any other) resource in the
>> controller?
>> Now I'm using following line:
>> $this->getFrontController()->getParam('bootstrap')->getResource('db');
>> 
>> Is there a better way?
> 
> Within your controller, yes, there's an easier way:
> 
>     $this->getInvokeArg('bootstrap')->getResource('db');
> 
> -- 
> Matthew Weier O'Phinney
> Project Lead            | matt...@zend.com
> Zend Framework          | http://framework.zend.com/
> 
> 

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

Reply via email to