更改zend框架中的默认控制器

ktm*_*ktm 0 zend-framework

我尝试通过在application.ini中添加此行来将主页设置为indexController之外的另一个控制器

resources.frontController.defaultControllerName="site"
Run Code Online (Sandbox Code Playgroud)

我没有看到任何变化,索引控制器再次加载,我该如何更改此帮助.

Kri*_*pal 5

如果你没有模块化结构,那么设置fol.ing到application.ini应该工作

resources.frontController.defaultControllerName = "site"
resources.frontController.defaultAction = "action"
Run Code Online (Sandbox Code Playgroud)

如果您有模块化结构,请添加以下内容

resources.frontController.defaultControllerName = "site"
resources.frontController.defaultAction = "actionName"
resources.frontController.defaultModule = "moduleName"
resources.frontController.params.prefixDefaultModule = "1"
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
Run Code Online (Sandbox Code Playgroud)

我总是在我的application.ini的[production]下添加这样的设置,因为这些设置对于其他staging,dev,测试环境是相同的,我继承了这样的生产设置

[staging: production]
[development : staging]
Run Code Online (Sandbox Code Playgroud)

确保以正确的形式在application.ini中创建控件和操作.还要确保你没有做任何超过application.ini设置的前锋

希望这可以帮助