I accessed the view object like this in a resource plugin, might work in the
bootstrap also.
 
$viewRenderer =
Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
$viewRenderer->init();
$this->_view = $viewRenderer->view;

Take a look at
http://www.atirjavid.com/web-development/8-zend-framework-tutorials/4-a-modu
lar-directory-structure-quickstart-module-switcher-front-controller-plugin.h
tml it is where I got the code.

Or, you could extend you controller file and put in a preDispatch() and set
the path's there.

class Core_Plugins_Controller_DefaultController extends
Zend_Controller_Action {

public function preDispatch() {
        $this->view->addScriptPath(PATH);
        $this->view->addHelperPath(PATH);
}

}

class IndexController extends Core_Plugins_Controller_DefaultController {
...
}

Terre
________________________________

From: Hector Virgen [mailto:djvir...@gmail.com] 
Sent: Wednesday, February 03, 2010 12:03 AM
To: fw-general@lists.zend.com
Subject: Re: [fw-general] Module Resource View Helpers not available to
Layout


Sorry to bring up an old topic but I'm running into an issue trying to
accomplish this. 

I have a module bootstrap that is throwing an exception when I try to access
the "view" resource. Any idea what I might be doing wrong?

http://pastie.org/807111

--
Hector



On Sun, Dec 20, 2009 at 1:34 PM, Matthew Weier O'Phinney <matt...@zend.com>
wrote:


        -- Ant Cunningham <ant.cunning...@gmail.com> wrote
        (on Sunday, 20 December 2009, 01:09 PM -0500):
        
        > Im currently porting a 1.7 version of an application to 1.9 and
        > trying to make use of the Module bootstrapping, but i think im
        > confused on a key point...
        >
        > I have a few view helpers that are actually used by the Layout but
        > are in a "module namespace" (MyModule_View_Helper_*) as opposed to
a
        > "global namespace" (My_View_Helper_*). They dont seem to be
        > available by default for the Layout to use when using the module
        > autoloader resource.
        >
        > I was under the impression the module bootstrapping process front
        > loaded all the resources for all modules (or in my case all
enabled
        > modules). Is this not the case or am i doing it wrong?
        
        
        Module bootstrapping sets up autoloading, but it doesn't
automatically
        add view helper/script/filter paths to the view; that must be done
        manually currently.
        
        (Autoloading !== plugin loading, though the latter is affected by
the
        former.)
        
        --
        Matthew Weier O'Phinney
        Project Lead            | matt...@zend.com
        Zend Framework          | http://framework.zend.com/
        



Reply via email to