Zend Route incorrect relative path

爱⌒轻易说出口 提交于 2019-12-25 03:37:29

问题


My routes work fine apart from when I am at an action that requires a parameter. For example, these work ok:

/news
/news/admin
/news/admin/add

But this doesn't:

/news/admin/edit/1

But only routes using the 'default' route render incorrectly (they render as ../../module/controller), all other routes render correctly (/module/conntroller)

Any ideas why, or how to fix it?


回答1:


It's a common problem.

If you are using custom routes in your navigation you must explicitly pass 'default' route to Zend_Navigation pages and url() view helpers.

Also your page parameters must match parameters defined in Zend_Navigation




回答2:


If you aren't using custom routes, your route has to look like this:

/news/admin/edit/id/1

Where there always have to be a pair of /param/value.



来源:https://stackoverflow.com/questions/3530448/zend-route-incorrect-relative-path

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!