80 lines
1.9 KiB
PHP
80 lines
1.9 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Modules\Error;
|
||
|
|
|
||
|
|
use App\Core\Controller as BaseController;
|
||
|
|
|
||
|
|
class Controller extends BaseController
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* 404 Not Found page
|
||
|
|
*/
|
||
|
|
public function notFound()
|
||
|
|
{
|
||
|
|
return $this->view('Error.view.404', [
|
||
|
|
'title' => '404 - Page Not Found',
|
||
|
|
'message' => 'The page you are looking for could not be found.',
|
||
|
|
'code' => 404
|
||
|
|
], 404);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 500 Internal Server Error page
|
||
|
|
*/
|
||
|
|
public function serverError($exception = null)
|
||
|
|
{
|
||
|
|
return $this->view('Error.view.500', [
|
||
|
|
'title' => '500 - Server Error',
|
||
|
|
'message' => 'Something went wrong on our end.',
|
||
|
|
'code' => 500,
|
||
|
|
'exception' => $exception
|
||
|
|
], 500);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 403 Forbidden page
|
||
|
|
*/
|
||
|
|
public function forbidden()
|
||
|
|
{
|
||
|
|
return $this->view('Error.view.403', [
|
||
|
|
'title' => '403 - Forbidden',
|
||
|
|
'message' => 'You do not have permission to access this resource.',
|
||
|
|
'code' => 403
|
||
|
|
], 403);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 401 Unauthorized page
|
||
|
|
*/
|
||
|
|
public function unauthorized()
|
||
|
|
{
|
||
|
|
return $this->view('Error.view.401', [
|
||
|
|
'title' => '401 - Unauthorized',
|
||
|
|
'message' => 'You need to be authenticated to access this resource.',
|
||
|
|
'code' => 401
|
||
|
|
], 401);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 419 CSRF Token Mismatch
|
||
|
|
*/
|
||
|
|
public function csrfMismatch()
|
||
|
|
{
|
||
|
|
return $this->view('Error.view.419', [
|
||
|
|
'title' => '419 - CSRF Token Mismatch',
|
||
|
|
'message' => 'Your session has expired. Please try again.',
|
||
|
|
'code' => 419
|
||
|
|
], 419);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Error Reports page
|
||
|
|
*/
|
||
|
|
public function reports()
|
||
|
|
{
|
||
|
|
return $this->view('Error.view.reports', [
|
||
|
|
'title' => 'Error Reports - Woles Framework'
|
||
|
|
]);
|
||
|
|
}
|
||
|
|
}
|