zend框架中的模块结构

时间:2013-08-21 12:54:11

标签: zend-framework

我从简单的目录结构转移到zend framworks的管理模块结构。这是我的目录结构

firstproject    -应用       -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',消息'指定了无效的控制器(错误)'

我不知道模块结构。任何人都可以帮助正确的模块结构及其重定向......

0 个答案:

没有答案