Blame view

yohobuy/m.yohobuy.com/application/controllers/Error.php 977 Bytes
hf authored
1
<?php
2
hf authored
3
/**
hf authored
4 5
 * 错误错误控制器
 * 
hf authored
6 7 8 9 10 11 12 13
 * @name ErrorController
 * @desc 错误控制器, 在发生未捕获的异常时刻被调用
 * @see http://www.php.net/manual/en/yaf-dispatcher.catchexception.php
 */
use Action\AbstractAction;

class ErrorController extends AbstractAction
{
14
hf authored
15
    public function indexAction()
hf authored
16 17 18
    {
        header('HTTP/1.1 404 Not Found');
        header('Status: 404 Not Found');
xuqi authored
19
        $this->_view->display('index');
hf authored
20
    }
21
hf authored
22 23 24 25
    public function errorAction($exception)
    {
        header('HTTP/1.1 404 Not Found');
        header('Status: 404 Not Found');
26 27 28 29 30 31 32 33 34 35 36 37

        // 设置网站标题
        $this->setTitle('页面不存在');
        $this->setNavHeader('抱歉,页面不存在!', true, SITE_MAIN);

        // 生成HTML (error.html)
        $this->_view->html('error');
        // 渲染模板
        $this->_view->display('index', array(
            'pageFooter' => true,
            'showDownloadApp' => true,
        ));
hf authored
38 39 40
    }

}