2011-09-20 07:05:48 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class ErrorController extends Zend_Controller_Action
|
|
|
|
{
|
2012-06-11 01:44:10 +00:00
|
|
|
function preDispatch()
|
|
|
|
{
|
|
|
|
$this->view->config = Zend_Registry::get('config');
|
|
|
|
$this->db=Zend_Registry::get('db');
|
|
|
|
}
|
|
|
|
|
2011-09-20 07:05:48 +00:00
|
|
|
public function errorAction()
|
|
|
|
{
|
|
|
|
$errors = $this->_getParam('error_handler');
|
2012-06-11 01:44:10 +00:00
|
|
|
|
2011-09-20 07:05:48 +00:00
|
|
|
switch ($errors->type) {
|
2012-06-11 01:44:10 +00:00
|
|
|
|
|
|
|
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
|
|
|
|
|
|
|
|
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
|
|
|
|
|
2011-09-20 07:05:48 +00:00
|
|
|
// 404 error -- controller or action not found
|
|
|
|
$this->getResponse()->setRawHeader('HTTP/1.1 404 Not Found');
|
2012-06-11 01:44:10 +00:00
|
|
|
$title = "您所访问的页面未找到";
|
|
|
|
$content = '您所访问的页面未找到<br />
|
|
|
|
The page you requested was not found.';
|
2011-09-20 07:05:48 +00:00
|
|
|
break;
|
2012-06-11 01:44:10 +00:00
|
|
|
|
|
|
|
default:
|
2011-09-20 07:05:48 +00:00
|
|
|
// application error
|
2012-06-11 01:44:10 +00:00
|
|
|
$title = "服务器内部错误";
|
|
|
|
$content = '服务器开了小差,请稍后再试或联系管理员<br />
|
|
|
|
An unexpected error occurred. Please try again later.';
|
2011-09-20 07:05:48 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Clear previous content
|
|
|
|
$this->getResponse()->clearBody();
|
2012-06-11 01:44:10 +00:00
|
|
|
|
|
|
|
$this->view->title = $title;
|
2011-09-20 07:05:48 +00:00
|
|
|
$this->view->content = $content;
|
|
|
|
}
|
2012-06-11 01:44:10 +00:00
|
|
|
|
|
|
|
public function authorityAction(){
|
|
|
|
|
|
|
|
}
|
2011-09-20 07:05:48 +00:00
|
|
|
}
|