开发者

zend modules default controller

开发者 https://www.devze.com 2023-04-07 06:32 出处:网络
Hy guys, how can i set the default modules controller ?? i need that if there isn\'t controller in module folder, i come at default module controller and view!

Hy guys,

how can i set the default modules controller ??

i need that if there isn't controller in module folder, i come at default module controller and view!

for example i type into the browser: http://192.168.1.100/Testmoduli/public/givep/

where givep is my module without IndexController.php, now i need to come at my default module (artapp) into IndexController.php

resources.frontController.defaultController = "index" 
resources.frontController.defaultAction = "index" 
resources.frontC开发者_JAVA技巧ontroller.defaultModule = "artapp" 
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"

thanks!

EDIT:

so..

If I try to launch an action that does not exist, it is automatically launched in the same action in the form of default?

to launch this action can i only catch the action into controller error??

thanks!


You can do this in your ErrorController :

// in errorAction()
if($this->_error->type == 'EXCEPTION_NO_CONTROLLER'){
     // redirect or forward where you want
}
0

精彩评论

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