2010年6月23日星期三

[fw-mvc] Extending navigation view helpers

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

没有评论: