Hello All,

        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]
    }
}

[In APPLICATION_PATH/application/layouts/scripts/layout.phtml]

<div id="header"> <div id="logged-in-as">
    <?php echo $this->loggedInAs(); ?> </div>
</div>

...

According to all the documentation that I have read, by default the
autoloader will look in the modules/[module_name]/views/helpers by default
first, and then fallback automatically to the
APPLICATION_PATH/views/helpers, so in theory my modules don't have this
helper, so it should revert back to the 'default' views/helpers path to find
the helper if I am understanding correctly.

My application bootstrap file has nothing that modifies any views or layouts
at this time, (I haven't even added the commonly used _initDoctype()
function yet to my bootstrap).

My configs/application.ini looks like this:

[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
phpSettings.date.timezone = "America/Edmonton"

includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "App"
resources.frontController.controllerDirectory = APPLICATION_PATH
"/controllers"
resources.frontController.params.displayExceptions = 0

resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"
resources.view[] =

resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules[] =

resources.db.adapter = "pdo_mysql"
resources.db.params.charset = "utf8"
resources.db.params.host = "localhost"
resources.db.params.username = "not_shown"
resources.db.params.password = "not_shown"
resources.db.params.dbname = "not_shown"
resources.db.isDefaultTableAdapter = true

Any suggestions on what I am missing (or any further information that I have
not provided) to indicate why the view helper works on the default module
but fails on other modules would helpful.

On a final note, all my modules have a bootstrap file, which basically has a
method to add itself to the registry (nothing that would affect the views or
layouts.

Thank you in advance for your help
Aaron


Reply via email to