开发者

Zend: Separate default controller for default module vs custom module?

What I'm trying to achieve is to use the news controller as the default controller for my default module, and my index controller for my admin module.

As of right now, because my Admin Bootstrap is being applied, my default module's default controller name is now index instead of news ( I want the latter ). The admin itself is fine. How could I edit my settings such to get what I need?

My application.ini settings:

bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
resources.modules[] = ''
resources.frontController.defaultControllerName = "news"
resources.frontContro开发者_C百科ller.defaultModule = "default"
resources.frontController.defaultAction = "index"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.frontController.moduleControllerDirectoryName = "controllers"
resources.view[] = ''
admin.resources.frontController.defaultControllerName = index
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts"

I have just my standard, vanilla structure along with modules/admin ( I had to rename the IndexController class name to be Admin_IndexController and I had to create a Bootstrap in modules/admin ) in order for the admin module's default controller to be index and not news.


An easy fix would be to have an indexController and to forword actions to newsController.

But if you want you could go ahead and subclass the control dispatcher to return different default controllers based on module http://framework.zend.com/manual/en/zend.controller.dispatcher.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜