0

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.

6
  • 2
    This is supposed to work. Could you copy paste your application.ini and your bootstrap? Commented Feb 24, 2012 at 15:44
  • One more thing, is "site" a valid controller? Commented Feb 24, 2012 at 15:47
  • that's all my bootstrap protected function _initNavigation() { $this->bootstrap('layout'); $layout = $this->getResource('layout'); $view = $layout->getView(); $navigation = new Zend_Navigation($this->getOption('navigation')); $view->navigation($navigation); } Commented Feb 24, 2012 at 15:55
  • did you add resources.frontController.defaultControllerName="site" in the good section of your application.ini (production, dev...) ? Commented Feb 24, 2012 at 16:00
  • i did add it on [development : production] and also production and i also tried default.resources.frontController.defaultControllerName="site" no luck, just nothing happen i get index controller loaded as usual Commented Feb 24, 2012 at 16:07

1 Answer 1

5

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.