Zend框架中如何获取调度的路由名称?
当前状态:
- 从 xml 文件加载路由器,
- 路由器内的两个路由名称将前往相同的控制器和操作,例如:www-language-employee 和 www-language-trainer 将前往相同的控制器和操作 --> ;员工控制器和listemployeeAction
问题: - 需要知道请求中调度/使用哪个路由名称。
例子: 1. http://www.mycompany.com/en/trainers/ 预期返回值:www-language-trainer
Current state:
- A router is loaded from xml file
- two route name within the router are going to the same controller and action, for example: www-language-employee and www-language-trainer are going to the same controller and action --> EmployeeController & listemployeeAction
Problem:
- Need to know which route name is dispatched/being used from a request.
Example:
1. http://www.mycompany.com/en/trainers/
Expected return value: www-language-trainer
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在我的例子中:
返回
Employeecontroller/:listtemployee
在
Employeecontroller
中:将返回
employee
或trainer
In my case :
returns
Employeecontroller/:listemployee
In
Employeecontroller
:would return either
employee
ortrainer