1
我有一个名为帐户的控制器和一个称为注销的操作。这很简单:在控制器中未找到操作。使用Zend框架,但行动是有
<?php
class AccountController extends CustomControllerAction
{
public function logoutAction()
{
Zend_Auth::getInstance()->clearIdentity();
$this->_redirect('/account/login');
}
但出于某种原因,我得到一个未捕获的异常
Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (error)' in /Library/WebServer/Documents/phpweb20/include/Zend/Controller/Dispatcher/Standard.php:248 Stack trace: #0 /Library/WebServer/Documents/phpweb20/include/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 /Library/WebServer/Documents/phpweb20/htdocs/index.php(67): Zend_Controller_Front->dispatch() #2 {main} thrown in /Library/WebServer/Documents/phpweb20/include/Zend/Controller/Dispatcher/Standard.php on line 248
我并没有与任何其他操作或控制器的一个问题。我的loginAction工作正常。我的registerAction正常工作....
任何人都知道为什么会发生这种情况?
Jonesy
错误表示尝试查找_error_控制器失败。此控制器默认情况下会处理所有异常,因此值得添加,以便您可以查看实际问题。请参阅http://framework.zend.com/manual/en/zend.controller.plugins.html上的ErrorHandler部分。 – 2010-07-13 16:39:44
@Tim在我看到您的评论之前发布我的答案。如果你想自己发布,只需说出我的意思,那么我就不会让你的问题变得更快。 – Iznogood 2010-07-13 16:42:19
@Tim感谢您的回复,我创建了一个错误控制器来记录错误,看起来我收到了“无法发送标题;标题已发送”错误。我不确定如何去现在重定向 – iamjonesy 2010-07-14 05:50:14