开发者

How to set default module with zend route?

I've three module

  • default
  • frontend
  • backend

I'd like to hide default and frontend module from t开发者_JS百科he url

So I'd like to set the module depending on the controller

because the defautl module is only used for errorController

Thank you


You can specify default controller directories by doing something like this:

$front->setControllerDirectory('../application/modules/default/controllers');

To do it in the application config file:

resources.frontController.controllerDirectory = APPLICATION_PATH "/modules/default/controllers"

This will allow the error controller to be accessed by by both modules.

To change the default route, you'll need to add this to your routes.ini and change the modules/controllers.

routes.index.type = "Zend_Controller_Router_Route"
routes.index.route = "/"
routes.index.defaults.module = "default"
routes.index.defaults.controller = "index"
routes.index.defaults.action = "index"
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜