日期:2014-05-20 浏览次数:20719 次
单模块布局目录: 单模块布局的application.ini配置: Bootstrap:
application/
??? configs/
??? controllers/
??? models/
??? views/
??? Bootstrap.php
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
??? protected function _initAutoload()
??? {
??????? $moduleLoader = new Zend_Application_Module_Autoloader(array(
??????????? 'namespace' => '',?
??????????? 'basePath' => APPLICATION_PATH));
??????? return $moduleLoader;
????????
??? }
多模块布局目录:
application/
??? Bootstrap.php
??? configs/
??? modules/
??????? default/
??????????? controllers/
??????????? models/
??????????? views/
??????? admin/
??????????? controllers/
??????????? models/
??????????? views/
?
?
多模块布局的application.ini配置:
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules/"
resources.frontController.moduleControllerDirectoryName = "controllers"
resources.frontController.defaultModule = "default"
Bootstrap:
??? protected function _initAutoload()
??? {
??????? $default_autoloader = new Zend_Application_Module_Autoloader(array(
??????????? 'namespace' => 'Default',
??????????? 'basePath' => APPLICATION_PATH . '/modules/default',
??????? ));
?? $admin_loader = new Zend_Application_Module_Autoloader(array(
????? 'namespace' => 'Admin',
????? 'basePath' => APPLICATION_PATH . '/modules/admin',
?? ));
??? }
转自:http://blog.sina.com.cn/s/blog_691b9e0d0100r1tg.html