Zend Framework中子域上的路由模块 [英] Route module on subdomain in Zend Framework
问题描述
我无法使 Zend_Controller_Router_Route_Hostname
正常工作。
我正在使用Zend Framework 1.9 .4
I'm using Zend Framework 1.9.4
在我的配置中,我有:
resources.router.routes.www.type = "Zend_Controller_Router_Route_Hostname"
resources.router.routes.www.route = ":module.domain"
resources.router.routes.www.defaults.module = "frontend"
resources.router.routes.www.chains.index.type = "Zend_Controller_Router_Route"
resources.router.routes.www.chains.index.route = ":controller/:action/*"
resources.router.routes.www.chains.index.defaults.controller = "index"
resources.router.routes.www.chains.index.defaults.action = "index"
乍一看,它看起来还不错。我有两个模块:
At first look it seems to work just fine. I have two modules:
services.domain
admin.domain
和默认的模块前端,可以回答所有其他不存在的问题。
and the default module frontend, answers to everything else that does not exist.
我可以访问 services.domain / mycontroller / myaction /
,我从正确的模块中获得正确的控制器和操作。
I can access services.domain/mycontroller/myaction/
and i get the right controller and action, from the right module.
但这是我的问题:
我无法指定参数。 FX,如果我去:
But here comes my problem: I can't specify parameters. F.x if i go to:
services.domain/mycontroller/myaction/key1/value1/key2/value2
我将收到无效的控制器异常,因为它随后尝试在前端模块而不是服务模块中找到mycontroller。
I will get an invalid controller exception, because it then tries to find mycontroller in the frontend module - not the services module.
我尝试弄乱 Zend_Controller_Router_Route
并告诉它接收特定的参数-这很好,但是我只是希望能够像默认设置一样动态地拥有所有参数。
I tried messing around with the Zend_Controller_Router_Route
and tell it to recieve a specific param - this works just fine, however i just want to be able to have all params dynamiclly like the default setup.
我的设置有什么问题?
What's wrong with my setup?
推荐答案
经过一整天的狩猎,我发现不是我,这是一个已经提交了几个月的错误前。
After a good day of hunting, I figured out that it's not me, it's a bug that has already been submitted several months ago.
http:// framework .zend.com / issues / browse / ZF-6654
我希望这对其他人有帮助。
I can just hope this helps someone else.
这篇关于Zend Framework中子域上的路由模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!