views:

372

answers:

2

I'm having trouble getting the Zend_Controller_Router_Route_Hostname to work properly.

I'm using Zend Framework 1.9.4

In my config I have:

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.

I can access services.domain/mycontroller/myaction/ and i get the right controller and action, from the right module.

But here comes my problem: I can't specify parameters. F.x if i go to:

services.domain/mycontroller/myaction/key1/value1/key2/value2

I will get an invalid controller exception, because it then tries to find mycontroller in the frontend module - not the services module.

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?

A: 

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.

Ole
A: 

The fix for this bug will be released on 26/Jan/10.

See here: http://framework.zend.com/issues/browse/ZF/fixforversion/10360

Dan