Error.php 788 Bytes
<?php
/**
 * 错误错误控制器
 * 
 * @name ErrorController
 * @desc 错误控制器, 在发生未捕获的异常时刻被调用
 * @see http://www.php.net/manual/en/yaf-dispatcher.catchexception.php
 */
use Action\AbstractAction;

class ErrorController extends AbstractAction
{
    
    public function indexAction()
    {
        header('HTTP/1.1 404 Not Found');
        header('Status: 404 Not Found');
    }
    
    public function errorAction($exception)
    {
        header('HTTP/1.1 404 Not Found');
        header('Status: 404 Not Found');
        
        // @todo debug
        echo $exception->getMessage();
        
//        // 生成HTML (error.html)
//        $this->_view->html('error');
//        // 渲染模板
//        $this->_view->display('error');
    }

}