Search code examples
zend-frameworkrouteszend-route

how to make routing URL for our wish in zendframework using routes.ini file?


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.


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