Error.php
998 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?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');
$this->_view->display('index');
}
public function errorAction($exception)
{
header('HTTP/1.1 404 Not Found');
header('Status: 404 Not Found');
// @todo debug
//echo $exception->getMessage();
// 设置网站标题
$this->setTitle('页面不存在');
$this->setNavHeader('抱歉,页面不存在!', true, SITE_MAIN);
$this->_view->display('index', array(
'errorPage' => array(
'newProductLink' => '###'
),
'pageFooter' => true
));
}
}