小编Mar*_*cin的帖子

我如何处理Kohana 3.3中的所有错误

我如何处理Kohana 3.3中的每个错误?我的意思是没有404/505错误但是来自php和其他php的错误的"致命错误"?

我查看了http://kohanaframework.org/3.3/guide/kohana/tutorials/error-pages并且我做了这些事情,但是它只处理了404/505错误(以及其他错误).我无法处理500错误.

我创建文件/APP/Classes/HTTP/Exception/500.php

class HTTP_Exception_500 extends Kohana_HTTP_Exception_500 {

    public function get_response()
    {
        $session = Session::instance();
        $view = View::factory('index');
            $view->content = View::factory('errors/505');
        $view->title = 'Wewn?trzny b??d';
        // Remembering that `$this` is an instance of HTTP_Exception_404
            $view->content->message = 'Wyst?pi? wewn?trzny b??d. Szczegó?y zosta?y     przekazane do administracji, naprawimy to!';

        $response = Response::factory()
            ->status($this->getCode())
            ->body($view->render());

        return $response;
    }
Run Code Online (Sandbox Code Playgroud)

但它不起作用..谢谢:)

php kohana

2
推荐指数
1
解决办法
1907
查看次数

标签 统计

kohana ×1

php ×1