开发者

Adding helper paths in Zend Framework for nested helpers

开发者 https://www.devze.com 2022-12-23 01:32 出处:网络
Does every level of view helpers really have to be added as its own sepa开发者_开发百科rate path?

Does every level of view helpers really have to be added as its own sepa开发者_开发百科rate path?

What I mean is this. I have found Zend's method of naming and nesting files a great way to organize user.php lives in the object folder and extends object.php. /DisplayObject /Object User.php

I started attempting to organize my view helpers in the same manner, but from what I'm reading, it almost looks like I would have to add the path for every single view helper, in which case they would lose their nested name, as you would only be calling the method name off of view (ie $this->user() instead of $this->displayObject_Object_User() or something to that extent.) The other alternative being having each level that's extended being a proxy to call the correct helper (a la the navigation sub helpers $this->navigation->links()).

That seems like a very poorly thought out design. No?


ZF use in yours helpers namespaces. For examples.

Zend_View_Helper_Navigation_Breadcrumbs Zend_View_Helper_Navigation_Links Zend_View_Helper_Navigation_Menu

I don't know if is the best way but is the Zend way

your first option like me more.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号