ErrorController.php (895B)
1 <?php 2 3 /** 4 * Class Error 5 * This controller simply contains some methods that can be used to give proper feedback in certain error scenarios, 6 * like a proper 404 response with an additional HTML page behind when something does not exist. 7 */ 8 class ErrorController extends Controller 9 { 10 /** 11 * Construct this object by extending the basic Controller class 12 */ 13 public function __construct() 14 { 15 parent::__construct(); 16 } 17 18 /** 19 * Use this when something is not found. Gives back a proper 404 header response plus a normal page (where you could 20 * show a well-designed error message or something more useful for your users). 21 * You can see this in action in action in /core/Application.php -> __construct 22 */ 23 public function error404() 24 { 25 header('HTTP/1.0 404 Not Found', true, 404); 26 $this->View->render('error/404'); 27 } 28 }