-- bingomanatee <[email protected]> wrote
(on Wednesday, 04 November 2009, 10:02 AM -0800):
> I am attempting to design a "Druplally" framework around ZF and I want to
> allow the module's bootstrap to have access to the View object (for helper
> registration etc.) 
> 
> When I put the following in the MAIN bootstrap file
> 
> <code>
>     public function _initHelpers () {
> 
>         $this->bootstrap('view');
>         $view = $this->getResource('view');
>     }
> </code>
> 
> it works fine. (I have resources.view[] = in my main configuration.) 
> 
> However the same code in a MODULE'S bootstrap crashes: 

When in a module bootstrap, you need to grab it from the application
bootstrap, which, cryptically, you retrieve with the getApplication()
method:

    public function _initHelpers()
    {
        $bootstrap = $this->getApplication();
        $bootstrap->bootstrap('View');
        $view = $bootstrap->getResource('View');
        // ...
    }


-- 
Matthew Weier O'Phinney
Project Lead            | [email protected]
Zend Framework          | http://framework.zend.com/

Reply via email to