这是我第一次使用 Zend 框架。我正在尝试遵循快速入门教程。在我到达Error Controller 和 View部分之前,一切都按预期工作。当我导航到一个不存在的页面时,我没有收到错误页面,而是得到了致命错误屏幕转储(这很荣耀):
致命错误:在 /home/.fantasia/bcnewman/foo.com/library/Zend/Controller/Dispatcher/Standard.php:249 堆栈跟踪:#0 / home/.fantasia/bcnewman/foo.com/library/Zend/Controller/Front.php(946): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 /home/.fantasia/bcnewman/foo .com/public/index.php(42): Zend_Controller_Front->dispatch() #2 {main} 在 /home/.fantasia/bcnewman/foo.com/library/Zend/Controller/Dispatcher/Standard.php 上线249
我不相信这是由我的语法错误引起的(从教程中复制并粘贴了示例文件的内容),我相信我的应用程序目录结构是正确的:
./application
./application/controllers
./application/controllers/IndexController.php
./application/controllers/ErrorHandler.php
./application/views
./application/views/scripts
./application/views/scripts/index
./application/views/scripts/index/index.phtml
./application/views/scripts/error
./application/views/scripts/error/error.phtml
./application/bootstrap.php
./public
./public/index.php
最后,IndexController
andindex.phtml
视图确实有效。