View helpers in modules – Rob Allen's DevNotes
I came across a situation last week where I needed to access a view helper that was in the default module's views/helpers directory when I was in another module. This came about because my layout.phtml uses a view helper that is in application/views/helpers.
By default, it doesn't work and you get an error along the lines of:
Plugin by name 'LoggedInAs' was not found in the registry; used paths:
The fix is simple enough. All you need to do is add this line to your application.ini file:
resources.view.helperPath.Zend_View_Helper = APPLICATION_PATH "/views/helpers"
This will then ensure that the view helpers in your application/views/helpers directory are always available.
This also works for accessing the view helpers in any other module too where the syntax looks like:
Finally, don't forget that the order is important if you have view helpers of the same name in different modules. Personally, I would try to avoid that if you possibly can :)