For each module (including the "default" module) be sure to add the view script helper path to application.ini. This will prepare your view instance for loading view helpers from any module, regardless of which module ends up being routed to.
; Add view helper paths for for default module: resources.view.helperPath.Default_View_Helper = APPLICATION_PATH "/views/helpers" ; Add view helper paths for each module: knowledgebase.resources.view.helperPath.Knowledgebase_View_Helper = APPLICATION_PATH "/modules/knowledgebase/views/helpers" othermodule.resources.view.helperPath.Othermodule_View_Helper = APPLICATION_PATH "/modules/othermodule/views/helpers" -- *Hector Virgen* Sr. Web Developer http://www.virgentech.com On Mon, Feb 28, 2011 at 4:45 PM, Markizano Draconus <[email protected]>wrote: > Hey Aaron, > > > I am having a bit of trouble with a view helper. I call a view >> helper in my layout, and it works fine when I am accessing the default >> module, however when I view a module page (with the same layout), I get an >> exception. >> >> [Exception information] >> >> Message: Plugin by name 'LoggedInAs' was not found in the registry; used >> paths: Knowledgebase_View_Helper_: >> >> /home/amurray/projects/bizweb/application/modules/Knowledgebase/views/helper >> s/ Zend_View_Helper_: Zend/View/Helper/ >> >> [In APPLICATION_PATH/application/views/helpers/LoggedInAs.php] >> >> class Zend_View_Helper_LoggedInAs extends Zend_View_Helper_Abstract { >> public function loggedInAs() { >> // [script inside function working fine] >> } >> } >> > > > Consider: > > class Knowledgebase_View_Helper_LoggedInAs extends > Zend_View_Helper_Abstract { > > public function loggedInAs() { > // [script inside function working fine] > } > } > > Instead of the class that you are using right now. > > By using the class name > > Zend_View_Helper_LoggedInAs > > It's implied that the file: > > Zend/View/Helper/LoggedInAs.php > > needs to be loaded. Unless this view helper actually was in the ZF library, > then that might be okay. However, it seems you are attempting to load > something in your default application/views/helpers path, which means, you > can use the default class names. > > Hope this helps, > -Kizano > //----- > Information Security > eMail: [email protected] > http://www.markizano.net/ >
