Created
January 24, 2010 19:04
-
-
Save ThePixelDeveloper/285377 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// HTTP request | |
$request = Request::instance(); | |
try | |
{ | |
$request->execute(); | |
} | |
/** | |
* HTTP error exception | |
*/ | |
catch (Kohana_HTTP_Exception $e) | |
{ | |
$request->response = $e->getMessage().'[ '.$e->getCode().' ]'; | |
} | |
// HTTP response | |
$response = $request->send_headers()->response; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Controller_Example extends Controller | |
{ | |
public function action_index() | |
{ | |
// Set status to 404 and throw http_exception | |
throw new Kohana_HTTP_Exception('This action doesn\'t exist', NULL, 404); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment