ÉricP
ÉricP

Reputation: 853

How to set default module with zend route?

I've three module

I'd like to hide default and frontend module from the url

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

because the defautl module is only used for errorController

Thank you

Upvotes: 0

Views: 5317

Answers (1)

t j
t j

Reputation: 7294

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"

Upvotes: 2

Related Questions