How to change the default action of the index controller zend

前端 未结 1 1228
遥遥无期
遥遥无期 2021-01-24 04:36

I have just created a new Zend project. I want to use the setDefaultAction to change the default action of the Index controller to any other action of the Index con

相关标签:
1条回答
  • 2021-01-24 05:31

    You could do this in your config

    ; application.ini
    resources.frontController.defaultAction = "about"
    

    Mind you, this will set the default action for all controllers.

    An alternative option would be to set a static route for the home page (/), eg

    ; application.ini
    resources.router.routes.home.type = "Zend_Controller_Router_Route_Static"
    resources.router.routes.home.route = "/"
    resources.router.routes.home.defaults.module = "default"
    resources.router.routes.home.defaults.controller = "index"
    resources.router.routes.home.defaults.action = "about"
    
    0 讨论(0)
提交回复
热议问题