Hello,

Placing your helpers under views/helpers is just an option. If you
want to specify your own location, you have to prepare a Zend_View
object in your bootstrap (or plugin) and use its addHelper() method,
then inject the object into the ViewRenderer with the setView()
method.

However, specifying the default prefix as Zend_View_Helper for helpers
placed under views/helpers/ doesn't make much sense since Zend prefix
is occupied by the official Zend Framework components, so if I wanted
to place helpers there at all (it's more likely that I have my own
library), I think the best would be to use nothing as default
namespace.

Another thing is that, if there's a directory to place my
site-specific view helpers and filters, why isn't there a place for my
action helpers and plugins? It would be very convinient to use these
instead adding my plugins and helpers manually in the bootstrap -- and
since I don't have extended/own classes in my library, only
plugins/helpers/filters I could eliminate the need of that directory.


Ádám

On Nov 8, 2007 7:37 AM, spaun <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> IMHO, current implementation of view helpers is a bit odd. I see no point in
> current naming convention (why special method name instead of fixed
> interface?).
>
> Furthermore, I see no normal way to configure the helper pathes/prefixes. If
> I understand it right, I intended to put my helpers to
> application/view/helpers and give a class Zend_View_Helper prefix. Changing
> it breaks the idea.
>
> I suppose it would be better to add and init script to helpers directory
> (something like __init__.php) and extend Zend_View to allow register helpers
> (something like registerHelper('helperName', callable $callback) and
> registerLazyHelper('helperName', $className, $methodName, $file = null)).
>
> The view object should handle setting the helper directory by including this
> init script thus providing self instance to it.
> --
> View this message in context: 
> http://www.nabble.com/Zend_View-enhancement-tf4769313s16154.html#a13642063
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>

Reply via email to