Domanda

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?

È stato utile?

Soluzione

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"
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top