Matthew Weier O'Phinney-3 wrote:
> 
>> 2.  In a common parent controller class, I add:
>> 
>>              $this->view->addHelperPath(Zend_Registry::get('applicationDir') 
>> .
>> '/lib',
>> 'My_View_Helper');
> 
> You need the full path to the helpers:
>     
>     Zend_Registry::get('applicationDir') . '/lib/My/View/Helper'
> 
> otherwise, it would be looking for them in just your lib dir, and would
> not find them.
> 
> 

As easy as that hey? :) Is there any mileage in a slight alteration to
loadClass that would look like this:

                $path = str_replace('_', '/', $prefix);
                if (Zend_Loader::isReadable($dir . $file)) {
                  include_once $dir . $file;
                } elseif (Zend_Loader::isReadable($dir . $path . $file)) {
                  include_once $dir . $path . $file;
                }

instead of what is there currently:

                if (Zend_Loader::isReadable($dir . $file)) {
                  include_once $dir . $file;
                }

Redundant perhaps, in light of your reply, but potentially still useful for
consistency?  I got confused and assumed that the prefixing the classes
would trigger path parsing as it does in other areas of the framework...

Thanks for the help,

Jamie.

-- 
View this message in context: 
http://www.nabble.com/Lazy-Autoloading-View-Helpers-Shared-Between-Modules-tp15925883s16154p15948583.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to