如何设置zend模块化应用程序

时间:2012-04-27 23:18:31

标签: php zend-framework module

我试图建立一个zend模块化应用程序,我的实际目录结构如下:

\Application
\Application\modules
\Application\modules\admin
\Application\modules\admin\...
\Application\modules\admin\Bootstrap.php
\Application\modules\front
\Application\modules\front\...
\Application\modules\front\Bootstrap.php
\...

我的application.ini文件包含:

[production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/modules/front/Bootstrap.php"
bootstrap.class = "Front_Bootstrap"
appnamespace = "Application"

resources.modules[] =
resources.view[] =

;FrontController Resource Settings
;resources.frontcontroller.controllerDirectory = APPLICATION_PATH "/modules/front/controllers"
resources.frontController.defaultController = "index"
resources.frontController.defaultAction = "index"
resources.frontController.defaultModule = "front"
resources.frontController.prefixDefaultModule = true
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.frontController.params.displayExceptions = 1


resources.db.adapter = "pdo_mysql"
resources.db.params.host = "localhost"
resources.db.params.username = "root"
resources.db.params.password = "test"
resources.db.params.dbname = "dbname"

;resources.layout.layoutPath = APPLICATION_PATH "/layouts/front/scripts"
resources.layout.layout = "layout"


[staging : production]

[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

当我尝试访问http://mywebserver/appname/public/时,我收到此错误:

Fatal error: Uncaught exception 'Zend_Application_Bootstrap_Exception' with message 'No default controller directory registered with front controller' in C:\wamp\www\go\library\Zend\Application\Bootstrap\Bootstrap.php on line 91
任何人都可以帮助PLZ! thnx提前。

2 个答案:

答案 0 :(得分:1)

可能取消注释您的resources.frontcontroller.controllerDirectory = APPLICATION_PATH“/ modules / front / controllers” 并尝试改变:

resources.frontController.defaultController = "index"

为:

resources.frontController.defaultControllerName = "index"

因为记录的参数是defaultControllerName

祝你好运!

答案 1 :(得分:0)

似乎问题是引导本身: 香港专业教育学院每个模块puted 1 bootstrap文件...当我删除它们并只留下主引导文件它工作正常。 谢谢你的答案。

相关问题