I checked Zend_Application_Module_Autoloader and did not see a controller
helper resource type, so either the manual is lying or I'm looking at the
wrong class. But even assuming that there is indeed an entry for
Controller_Helper, they still won't be found by the HelperBroker. What the
module autoloader does is allow you to call "new
Places_Controller_Helper_Acl();" without require'ing the file beforehand.
But the PluginLoader (used internally by the HelperBroker) can't use that.
The PluginLoader doesn't know beforehand the full classname of the helper
you want to load. What it does is loop through the list of registered
prefixes and paths, checks if a file with the short class name exists in the
file (e.g. "Acl.php") and if the file contains a class named {prefix + short
class name}, and then returns the first file that satisfies the above
criteria. It doesn't trigger PHP's autoloader.tl;dr: You still need to tell the HelperBroker the path where Places_Controller_Helper_* classes live even if they are already autoloadable. -- Mon On Thu, Feb 11, 2010 at 5:49 AM, Steve Rayner < [email protected]> wrote: > I found this in the reference guide; > > > > controllers/helpers/: These directories will contain action helpers. > Action helpers will be namespaced either as "*Controller_Helper_*" for the > default module or "<Module>_Controller_Helper" in other modules. > > > > So I have put my action helper here; > > > > /application/controllers/helpers/Acl.php > > > > My class is called; > > > > Places_Controller_Helper_Acl > > > > And I have registered the namespace in the bootstrap; > > > > $autoloader = new Zend_Application_Module_Autoloader(array( > > 'namespace' => 'Places_', > > 'basePath' => dirname(__FILE__), > > )); > > > > However, I still get the same error ‘class Places_Controller_Helper_Acl not > found. > > Do you know of an example that shows how to implement action controllers on > version 1.10? > > > > Steve Rayner > > > > *From:* fw-general-return-33728-srayner=williams-refrigeration.co.uk@ > lists.zend.com [mailto:fw-general-return-33728-srayner= > [email protected]] *On Behalf Of *Mon Zafra > *Sent:* 09 February 2010 22:05 > *To:* [email protected] > *Subject:* Re: [fw-general] Controller Action Helpers > > > > Paths are always relative to the public directory (with a few exceptions). > When in doubt, prepend APPLICATION_PATH. > > -- Mon > > On Wed, Feb 10, 2010 at 4:18 AM, Steve Rayner < > [email protected]> wrote: > > Can anyone help me with where to put my controller action helpers. > > > > I have this in my bootstrap; > > > > Zend_Controller_Action_HelperBroker::addPath('./controllers/helpers' , > 'Action_Helper'); > > > > My class lives in a file called; > > > > \application\controllers\helpers\AccessControl.php > > > > My class name is; Action_Helper_AccessControl > > > > The action helper does not seem to get loaded. Where an I going wrong? > > Is there a standard convention as to where action controllers should live? > > > > Steve Rayner > > > > > Williams Refrigeration is a trading name of AFE Group Limited. > Registered in England & Wales under Registered Number 3872673. Registered > Office Address - Bryggen Road, North Lynn, Industrial Estate, Kings Lynn, > Norfolk, PE30 2HZ > > Williams Refrigeration does filter email attachments for spam and viruses > and malicious content with Sophos Endpoint Security. While every care has > been made to ensure this message is secure we advise that you perform your > own checks as well on inbound messages. > > This e-mail and any files transmitted with it are confidential and intended > solely for the use of the individual or entity to whom they are addressed. > If you have received this email in error or are having trouble sending email > to Williams please notify the system administrator - > [email protected] > > Any views or opinions expressed in this e-mail are those of the sender and > do not necessarily coincide with those of Williams Refrigeration or the AFE > Group. > > > > Williams Refrigeration is a trading name of AFE Group Limited. > Registered in England & Wales under Registered Number 3872673. Registered > Office Address - Bryggen Road, North Lynn, Industrial Estate, Kings Lynn, > Norfolk, PE30 2HZ > > Williams Refrigeration does filter email attachments for spam and viruses > and malicious content with Sophos Endpoint Security. While every care has > been made to ensure this message is secure we advise that you perform your > own checks as well on inbound messages. > > This e-mail and any files transmitted with it are confidential and intended > solely for the use of the individual or entity to whom they are addressed. > If you have received this email in error or are having trouble sending email > to Williams please notify the system administrator - > [email protected] > > Any views or opinions expressed in this e-mail are those of the sender and > do not necessarily coincide with those of Williams Refrigeration or the AFE > Group. >
