ktm
ktm

Reputation: 6085

changing default controller in zend framework

I tried to set homepage as another controller than indexController by adding this line in application.ini

resources.frontController.defaultControllerName="site"

I don't see any changes, index controller load again, how do i change this pls help.

Upvotes: 0

Views: 6254

Answers (1)

Krishan Gopal
Krishan Gopal

Reputation: 4133

if you do not have modular structure then setting folowing to application.ini should work

resources.frontController.defaultControllerName = "site"
resources.frontController.defaultAction = "action"

If you have modular structure then add following

resources.frontController.defaultControllerName = "site"
resources.frontController.defaultAction = "actionName"
resources.frontController.defaultModule = "moduleName"
resources.frontController.params.prefixDefaultModule = "1"
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"

I always add such settings under [production] of my application.ini because these settings are same for other staging, dev, testing environments, i inherit production settings like this

[staging: production]
[development : staging]

Make sure you create the controller and action as you mention in application.ini in right form. Also make sure that you are not doing any forwards which is surpassing the settings of application.ini

hope this helps

Upvotes: 5

Related Questions