2024-03-30 02:29:56 +00:00
|
|
|
<?php /* Copyright (c) 2024 Freya Murphy */
|
2024-03-30 16:14:42 +00:00
|
|
|
class Error_model extends Model {
|
|
|
|
|
|
|
|
function __construct($load) {
|
|
|
|
parent::__construct($load);
|
|
|
|
}
|
2024-03-30 02:29:56 +00:00
|
|
|
|
|
|
|
private function get_msg(&$data) {
|
|
|
|
if (!array_key_exists('code', $_GET)) {
|
|
|
|
$data['msg'] = lang('error');
|
|
|
|
$data['title'] = '500';
|
|
|
|
} else {
|
|
|
|
$code = $_GET['code'];
|
|
|
|
$data['title'] = $code;
|
|
|
|
switch ($code) {
|
|
|
|
case '404':
|
|
|
|
$data['msg'] = lang('error_404');
|
|
|
|
break;
|
|
|
|
case '500':
|
|
|
|
$data['msg'] = lang('error_500');
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
$data['msg'] = lang('error');
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-30 16:14:42 +00:00
|
|
|
public function get_data(): array {
|
2024-03-30 02:29:56 +00:00
|
|
|
$data = parent::get_data();
|
|
|
|
$this->get_msg($data);
|
|
|
|
return $data;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|