2010年6月23日星期三

Re: [fw-mvc] Extending navigation view helpers

Thanks, Jeroen. I think I'll go with that for now, but it would be nice if there was a better way.

--
Hector


On Wed, Jun 23, 2010 at 3:46 PM, Jeroen Keppens <jeroen.keppens@gmail.com> wrote:
I ended up doing exactly that (you hack), so I'm really curious aswell to see other people's suggestions on this.

Jeroen

On 24 Jun 2010, at 00:40, Hector Virgen wrote:

> Hello,
>
> I need to extend Zend_View_Helper_Navigation_Menu to modify one of its methods. However, when calling $this->navigation()->menu() from within a view, I always get the ZF version instead of my custom version. This seems to happen because Zend_View_Helper_Navigation implicitly adds Zend/View/Helper/Navigation to the end of the view helper's plugin loader stack. Due to the stack being LIFO, it always returns the ZF helper instead of mine.
>
> Any suggestions on how to get around this? I'm considering giving my extended version a different name (such as "mymenu") but that seems like a bit of a hack.
>
> --
> Hector


没有评论: