I have the following URL: "http://localhost/mysite/blog/article/index/id/1"

module => blog
controller => article
action => index

and i want to structure my url like so: "http://localhost/mysite/blog/article/1" to set the default 'action' as 'index' and 'id' as '1'. Now how do i write such route in the config.ini file?

有帮助吗?

解决方案

resources.router.routes.article.route = "blog/article/:id"
resources.router.routes.article.defaults.module = "blog"
resources.router.routes.article.defaults.controller = "article"
resources.router.routes.article.defaults.action = "index"
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top