开发者

How to set default module with zend route?

开发者 https://www.devze.com 2023-02-17 17:29 出处:网络
I\'ve three module default frontend backend I\'d like to hide default and frontend module from t开发者_JS百科he url

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

精彩评论

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