Search code examples
phpzend-frameworkzend-controller-routerzend-router

How to use Zend_Config with the RewriteRouter?


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?


Solution

  • 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"