Nasıl bir Kohana v3 uygulaması için kurulum özel bir 404 sayfası için

0 Cevap php

Bu nasıl yapılabilir? Ben yaklaşık yarım saat boyunca bunu yapmak için çalışıyorum ve oldukça can sıkıcı oluyor. Bunu bu böyle bir çerçeve için kurulum için temel ve kolay bir şey olmalıdır olacaktır. Böyle temel Settings kurulumu çok zor eğer ben tüm bu çerçeveyi seçti olmamalıdır şey başlıyorum çünkü, belki ben kaçırdım kolay bir yolu var umuyoruz.

Bu hile yapmak gerekir, benim bootstrap.php dosyasında var.

if ( ! defined('SUPPRESS_REQUEST'))
{
    /**
     * Execute the main request. A source of the URI can be passed, eg: $_SERVER['PATH_INFO'].
     * If no source is specified, the URI will be automatically detected.
     */ 
    $request = Request::instance();
    try
    {
        // Attempt to execute the response
        $request->execute();
    }
    catch (Exception $e)
    {
        if (Kohana::$environment === Kohana::DEVELOPMENT)
        {
            // Just re-throw the exception
            throw $e;
        }
        echo "ok";
        // Create a 404 response
        $request->status = 404;
        $view = View::factory('error404');
        $request->response = $view->render();
    }

    echo $request->send_headers()->response;
}

Ama hala alıyorum

Fatal error: Uncaught Kohana_Request_Exception [ 0 ]: Unable to find a route to match the URI: test ~ SYSPATH\classes\kohana\request.php [ 674 ] thrown in C:\Xampp\htdocs\system\classes\kohana\request.php on line 674

instead of my custom 404 page. And yes, Kohana::$environment is set to Kohana::PRODUCTION;

Hatta echo "ok"; bölümü için almaz. Neden özel durum yakalandı almaz?

0 Cevap