我在 zend 框架中从简单的目录结构转移到管理员的模块结构。这是我的目录结构
firstproject -application -config -application.ini
-controllers
-here my controller
-models
-here is my model class
-views
-here is all views structure
-modules
-admin
-controllers
-here my controller for admin
-models
-here is my model class for admin
-views
-here is all views structure for admin
-bootstrap.php //bootstrap file for admin
-bootstrap.php // main bootstrap file
我的 application.ini 文件如下
[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.frontController.controllerDirectory = APPLICATION_PATH "modules/default/controllers"
resources.frontController.params.displayExceptions = 0
resources.frontController.moduleDirectory = APPLICATION_PATH"/modules"
;resources.frontController.params.prefixDefaultModule = "1"
;resources.frontController.defaultModule = "default"
;resources.frontController.defaultController = "index"
;resources.frontController.defaultAction = "index"
resources.modules[] = ""
resources.db.adapter = "pdo_mysql"
resources.db.params.host = "localhost"
resources.db.params.username = "root"
resources.db.params.password = ""
resources.db.params.dbname = "zend"
resources.db.isDefaultTableAdapter = true
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
[staging : production]
db.params.host = dev.example.com
db.params.username = devuser
db.params.password = devsecret
[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1
当我指向 url localhost/firstproject/admin/user/login 时,它的显示错误如致命错误:未捕获的异常 'Zend_Controller_Dispatcher_Exception' 并带有消息'指定的控制器无效(错误)'
我不知道模块结构。任何人都可以帮助正确的模块结构及其重定向...