我正在尝试使用前端和后端模块设置模块化 Zend Framework 项目,但我无法让它工作。public
当我在 Web 浏览器中访问我的目录时,我收到以下错误消息:
致命错误:在 /usr/share/ZendFrameworkCli/library/Zend/Controller/Dispatcher/Standard.php:248 中未捕获的异常 'Zend_Controller_Dispatcher_Exception' 和消息 'Invalid controller specified (error)' 堆栈跟踪:#0 /usr/share/ZendFrameworkCli /library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 /usr/share/ZendFrameworkCli/library/Zend/Application/Bootstrap/Bootstrap.php( 97): Zend_Controller_Front->dispatch() #2 /usr/share/ZendFrameworkCli/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run() #3 /Users/Martin/Dropbox/Repositories/realestatecms/public/ index.php(25): Zend_Application->run() #4 {main} 下一个异常 'Zend_Controller_Exception'带有消息“指定的控制器无效(错误)#0 /usr/share/ZendFrameworkCli/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) 在 /usr/第 336 行的 share/ZendFrameworkCli/library/Zend/Controller/Plugin/Broker.php
我已经使用 Zend Framework 命令行工具创建了这两个模块,这两个module
目录分别在 call和Bootstrap.php
中有两个类。Frontend_Bootstrap
Backend_Bootstrap
我的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 "/frontend/controllers"
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.frontController.params.displayExceptions = 0
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"
...
我做错了什么?当我在浏览器中访问http://example.com/public时,如何让我Frontend_IndexController()
运行?
编辑:如果我按照 Ivan 的回答用这些行更新我的配置文件,我现在会收到以下错误消息:
致命错误:在 /usr/share/ZendFrameworkCli/library/Zend/Application/Resource/Modules.php:83 中发现未捕获的异常“Zend_Application_Resource_Exception”和消息“为模块“默认”找到引导文件,但未找到引导类“Default_Bootstrap””跟踪:#0 /usr/share/ZendFrameworkCli/library/Zend/Application/Bootstrap/BootstrapAbstract.php(683): Zend_Application_Resource_Modules->init() #1 /usr/share/ZendFrameworkCli/library/Zend/Application/Bootstrap/BootstrapAbstract .php(626): Zend_Application_Bootstrap_BootstrapAbstract->_executeResource('modules')
2 /usr/share/ZendFrameworkCli/library/Zend/Application/Bootstrap/BootstrapAbstract.php(586):
Zend_Application_Bootstrap_BootstrapAbstract->_bootstrap(NULL) #3 /usr/share/ZendFrameworkCli/library/Zend/Application.php(355): Zend_Application_Bootstrap_BootstrapAbstract->bootstrap(NULL) #4 /Users/Martin/Dropbox/Repositories/realestatecms/public/index .php(25): Zend_Application->bootstrap() #5 {main} 在第 83 行的 /usr/share/ZendFrameworkCli/library/Zend/Application/Resource/Modules.php 中抛出
它是从哪里获得Default_Bootstrap
的类名?!