php newbie Posted March 1, 2013 Report Share Posted March 1, 2013 taisu pēc tutoriala fiendly error pages: http://kohanaframework.org/3.2/guide/kohana/tutorials/error-pagesextendoju Kohana_Exception klasi nokopejot kodu no tutoriala. Tur ir viena metode handle. testēju ar 2 kļūdam: Kohana_Exception un Kohana_HTTP_Exception (404). 1. Tā metode vispār netiek izsaukta kad izmet tas kļūdas2. Kad izmet Kohana_Exception, tiek izsaukts _handle 3. Kad izmet Kohana_HTTP_Exception netiek izsaukts ne handle, ne _handle.wtf? neko nesaprotu vispār.laikam būs vienkārši error view jāparraksta... Quote Link to comment Share on other sites More sharing options...
php newbie Posted March 1, 2013 Author Report Share Posted March 1, 2013 idiots. man ir uzinstalēta 3.3 versija... Quote Link to comment Share on other sites More sharing options...
daGrevis Posted March 1, 2013 Report Share Posted March 1, 2013 lol Quote Link to comment Share on other sites More sharing options...
php newbie Posted March 1, 2013 Author Report Share Posted March 1, 2013 (edited) Ok kad sapratu ka skatos nepareizas versijas dokumentāciju tad laikam aizgāja, bet vienalga dokumentācija nav pilnīga.Visiem HTTP exceptioniep pārrakstam application\classes\HTTP\Exception.php <?php defined('SYSPATH') OR die('No direct script access.'); class HTTP_Exception extends Kohana_HTTP_Exception { public function get_response() { // Lets log the Exception, Just in case it's important! Kohana_Exception::log($this); if (Kohana::$environment >= Kohana::DEVELOPMENT) { // Show the normal Kohana error page. return parent::get_response(); } else { $view = View::factory('error/http'); $response = Response::factory() ->status($this->getCode()) ->body($view->render()); return $response; } } } Visiem parējiem exceptioniem application\classes\Kohana\Exception.php: Vai nu visvienkāršakais variants pārrakstīt application\views\kohana\error.php Edited March 3, 2013 by php newbie Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.