开发者

Zend Framework routes not being applied

I have the follo开发者_高级运维wing routes in my application.ini:

resources.router.routes.user.route = "users/:id/*"
resources.router.routes.user.defaults.controller = users
resources.router.routes.user.defaults.action = profile
resources.router.routes.user.reqs.id = "\d+"

resources.router.routes.page.route = "pages/:date/*"
resources.router.routes.page.defaults.controller = pages
resources.router.routes.page.defaults.action = index
resources.router.routes.page.reqs.date = "\s+"

resources.router.routes.write.route = "pages/write/:type/*"
resources.router.routes.write.defaults.controller = pages
resources.router.routes.write.defaults.action = write
resources.router.routes.write.reqs.type = "\s+"

However, only the first is applied. ZF attempts to use the parameter as an action, so from what I can tell the route is simply ignored. What am I doing wrong that stops the other routes from working?


Figured it out. Routes were being ignored as I was using

resources.router.routes.write.reqs.type = "\s+"

I'm not even sure there is a \s, but used it out of guesswork (not sure why it worked before though).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜