这是我的第一个经验使用的Zend框架。我试图按照 快速启动 教程。一切都是工作,因为预计直到我到达的部分 错误的控制和查看.当我浏览一个页面,不存在,而不是接受的错误页面我得到的致命的错误屏幕转储(在所有的荣耀):

致命的错误:未捕获的例外'Zend_Controller_Dispatcher_Exception' 有消息'无效控制指定的(错误)'在 /home/.幻想曲/bcnewman/foo。com/library/Zend/控制/调度程序/标准。php:249 堆跟踪:#0 /home/.fantasia/bcnewman/foo.com/library/Zend/Controller/Front.php(946):Zend_Controller_Dispatcher_Standard->调度(目(Zend_Controller_Request_Http), 目(Zend_Controller_Response_Http))#1 /home/.fantasia/bcnewman/foo.com/public/index.php(42):在前端->派遣()#2{主}扔在 /home/.fantasia/bcnewman/foo.com/library/Zend/Controller/Dispatcher/Standard.php 在线249

我不相信这是引起的语法错误,我的一部分(a抄和粘贴的例子文件的内容从教程),我相信我有的应用程序目录的结构正确的:

./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

最后, IndexControllerindex.phtml 图做的工作。

有帮助吗?

解决方案

你必须ErrorHandler.php.它应该是ErrorController.php.控制器的所有人都需要名下的格式NameController.php.因为你没有它命名为适当的调度员无法找到它。

其他提示

假设你有ErrorController插件加载到你前面的控制,确保在你的引导,你没有下列设置:

$frontController->throwExceptions(true);

如果这是设置然后会例外 总是 会引发,不管你是否有一个错误控制器的设定。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top