Been pulling my hair out on why this is not working. Trying to register a controller action helper following e.g. found in Zend docs, several posts here and sundry blogs. Attempts were made both in application.ini and Bootstrap.
The helper itself resides in APPLICATION_PATH . "/controllers/helpers". The file itself is called Scoping.php. In application.ini, appnamespace = "".
<?php
class Helper_Scoping extends Zend_Controller_Action_Helper_Abstract
{
public function direct()
{
// code is here
}
}
First I tried in the application.ini:
resources.frontController.actionhelperpaths.Helper = APPLICATION_PATH "/controllers/helpers"
resources.frontController.plugins.Scoping = "Helper_Scoping"
Calling the following in my controller throws an exception with the message: "Action Helper by name Scoping not found":
$this->_helper->Scoping();
Then I tried the following in my Bootstrap (I tried both "Helper" and "Helper_" based on other examples I saw):
protected function _initActionHelpers()
{
Zend_Controller_Action_HelperBroker::addPath(
APPLICATION_PATH . '/controllers/helpers',
'Helper_'
);
Zend_Controller_Action_HelperBroker::addHelper(
new Helper_Scoping()
);
}
This time I get an uncaught exception, but same idea: "Fatal error: Class 'Helper_Scoping' not found in /Users/ppjd/Sites/dbos/application/Bootstrap.php on line 116"
Since there are so many working examples out there, I figure it must me missing something silly. Please SOS.