-- Ed West <[EMAIL PROTECTED]> wrote
(on Tuesday, 30 September 2008, 07:50 AM -0700):
> I'm having trouble using Zend_View::addHelper to add additional helper paths. 
> I have a project that lives in /home/ewest/project .  The standard
> Zend_View_Helper classes live under  /home/ewest/project/library/Zend/View/
> Helper.  /home/ewest/project/library is also part of my PHP include path.  My
> own helper classes reside under 
> /home/ewest/project/application/views/helpers. 
> There, I have my own Url helper class that should override the standard
> Zend_View_Helper_Url-- my version takes a string argument instead of an 
> array. 
> 
> In my base action class's initView method, I call:
> $this->view->addHelperPath('/home/ewest/project/library/Zend/View/Helper', 
> '');
> $this->view->addHelperPath('/home/ewest/project/application/views/helpers',
> '');

Zend_View does not allow adding helper paths with blank prefixes. Either
omit the second argument (the prefix 'Zend_View_Helper' will be
assumed), or specify your custom prefix. This will likely correct the
issue you're observing.

> However, I get errors like this on my test page:
> Error number: 2 Error string: fopen(/home/ewest/project/application/views/
> helpers/Doctype.php) [function.fopen]: failed to open stream: No such file or
> directory Error file: /home/ewest/project/library/Zend/Loader.php Error line:
> 160
> 
> If I remove the second call to addHelper, then I end up with the error:
> Catchable fatal error: Argument 1 passed to Zend_View_Helper_Url::url() must 
> be
> an array, string given
> 
> It seems that only one path is being used at a time instead of both.  I've
> checked the documentation-- does anyone have any idea what's going wrong?

-- 
Matthew Weier O'Phinney
Software Architect       | [EMAIL PROTECTED]
Zend Framework           | http://framework.zend.com/

Reply via email to