zend frameword 基本语法

#resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
#resources.frontController.moduleControllerDirectoryName ="controllers"
#resources.frontController.defaultModule ="default"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"

下面测试成功
resources.frontController.controllerDirectory.default =APPLICATION_PATH "/modules/default/controllers"
resources.frontController.controllerDirectory.admin =APPLICATION_PATH "/modules/admin/controllers"
resources.FrontController.moduleDirectory =APPLICATION_PATH "/modules"
resources.FrontController.moduleControllerDirectoryName ="controllers"
resources.FrontController.defaultModule= "default"

下面测试成功

resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"

两个都只可以访问default

http://192.168.1.188/zend/public/index/index
http://192.168.1.188/zend/public/admin/index/add

 

.$this->_forward($action,$controller=null,$module=null,array$params=null)
参数要至少写前两个,不然就会报错;
此跳转不会更改浏览器地址;

2.$this->_redirect($url,$options)
$url通常就是'controller/action',至于后面的$options我还没用过;
此跳转会改变浏览器地址;

3.$this->render('test')或$this->render('4-2.php')
此跳转会先进到test.phtml页面,再到该控制器下的testAction();
第二种情况就是跳转到对应的页面;

posted on 2015-03-31 18:00  小V_chen  阅读(385)  评论(0编辑  收藏  举报

导航