0

我试图建立一个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!提前谢谢。

4

2 回答 2

1

也许取消注释您的resources.frontcontroller.controllerDirectory = APPLICATION_PATH“/modules/front/controllers”并尝试更改:

resources.frontController.defaultController = "index"

至:

resources.frontController.defaultControllerName = "index"

因为记录的参数是defaultControllerName

祝你好运!

于 2012-04-28T06:40:29.700 回答
0

似乎问题在于它自己的引导程序:我为每个模块放置了 1 个引导程序文件……当我删除它们并只留下主引导程序文件时,它工作正常。谢谢你的回答。

于 2012-04-28T11:05:39.470 回答