sensimevanidus

22 July, 2010

Change Default Controller in Zend Framework

By default, Zend Framework dispatches a request to the IndexController if no other controller is defined (modules, controllers and actions are selected via URL). Like me, you may want to change the default controller for some reason. In Zend Framework, you can do that by adding or changing the resources.frontController.defaultControllerName property in the application.ini file. It looks like this:

resources.frontController.defaultControllerName = "auth"

Now Zend Framework sees the AuthController as the default controller.

That’s all. Hope this helps…