Question

I need to the routing URL like the following

http://www.website.com/module-name/controller-name/{article-name}/{article-id}

i tried using the routes.ini file but it's not working

routes.index-latest.route = "index/latest/$1/:id"
routes.index-latest.module = "index"
routes.index-latest.defaults.controller = "latest"
routes.index-latest.defaults.action = "index"
routes.index-latest.defaults.id = ""

can you anyone suggest me on the issues or please tell me any other way to achieve the URL like through bootstrap file.

i searched on the net but i am not getting the right solution.

Was it helpful?

Solution

i fixed myself like example @

routes.index-latest.route = "index/latest/:article_id" 
routes.index-latest.defaults.module = "module-name" 
routes.index-latest.defaults.controller = "controller-name" 
routes.index-latest.defaults.action = "action-name" 
routes.index-latest.defaults.article_id = "" 
routes.index-latest.defaults.reqs.article_id = "\d+{1,}"

in routes.ini

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top