Zend Router(如何将 /administration/users 等 url 定向到 Administration_UsersController)
我想保留旧的默认 Zend Router,只添加一个用于管理子页面的路由器,因为控制器的大小不断增加,我想在逻辑上将它们稍微分开并拥有更清晰的 URL。
该文档似乎解释了如何做其他事情,但没有解释这个......
I would like to keep the old default Zend Router, and just add a router for administration subpages since the controllers are growing in size and I would like to logically separate them a little as well as have cleaner URLs.
The documentation seems to explain how to do other things but not this...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这对于默认路由来说是开箱即用的。您只需要添加一个管理模块,然后
/administration/users
将映射到管理模块中的用户控制器。This will work out of the box with the default routes. You just need to add an administration module, and then
/administration/users
will map to the users controller in the administration module.我不知道是否可以使用下划线和大写用户来完成此操作,抱歉,但如果没有,您必须将以下内容添加到 bootstrap.php
注意:在这种情况下,您的控制器是:
I don't know if its possibile to do it with an Underscore and the upcase user, sorry, but without you had to add the following to your bootstrap.php
note: in this scenario your controller is: