31 lines
616 B
PHP
31 lines
616 B
PHP
<?php /* Copyright (c) 2024 Freya Murphy */
|
|
class ErrorModel extends Model {
|
|
|
|
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;
|
|
}
|
|
}
|
|
}
|
|
|
|
public function get_data() {
|
|
$data = parent::get_data();
|
|
$this->get_msg($data);
|
|
return $data;
|
|
}
|
|
}
|
|
?>
|