diff options
author | Freya Murphy <freya@freyacat.org> | 2024-03-30 12:14:42 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2024-03-30 12:14:42 -0400 |
commit | 1f04b83be337cc91a3fabcf4e574e2306f3d2eaa (patch) | |
tree | 74d7d65a7047e60d1877384e3c7b0d70c7b0e49a /web/routes/error | |
parent | start database (user and post), and initial barebones home page (diff) | |
download | xssbook2-1f04b83be337cc91a3fabcf4e574e2306f3d2eaa.tar.gz xssbook2-1f04b83be337cc91a3fabcf4e574e2306f3d2eaa.tar.bz2 xssbook2-1f04b83be337cc91a3fabcf4e574e2306f3d2eaa.zip |
refactor
Diffstat (limited to '')
-rw-r--r-- | web/_model/apps/error.php (renamed from web/routes/error/model.php) | 8 | ||||
-rw-r--r-- | web/routes/error/controller.php | 20 | ||||
-rw-r--r-- | web/routes/error/views/error.php | 4 |
3 files changed, 6 insertions, 26 deletions
diff --git a/web/routes/error/model.php b/web/_model/apps/error.php index a30fccc..ad72b28 100644 --- a/web/routes/error/model.php +++ b/web/_model/apps/error.php @@ -1,5 +1,9 @@ <?php /* Copyright (c) 2024 Freya Murphy */ -class ErrorModel extends Model { +class Error_model extends Model { + + function __construct($load) { + parent::__construct($load); + } private function get_msg(&$data) { if (!array_key_exists('code', $_GET)) { @@ -22,7 +26,7 @@ class ErrorModel extends Model { } } - public function get_data() { + public function get_data(): array { $data = parent::get_data(); $this->get_msg($data); return $data; diff --git a/web/routes/error/controller.php b/web/routes/error/controller.php deleted file mode 100644 index 3cb2345..0000000 --- a/web/routes/error/controller.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php /* Copyright (c) 2024 Freya Murphy */ -class ErrorController extends Controller { - - private $model; - - function __construct($model) { - parent::__construct(); - $this->model = $model; - } - - public function index() { - parent::index(); - $data = $this->model->get_data(); - $this->view('header', $data); - $this->app_view('error', $data); - } - -} - -?> diff --git a/web/routes/error/views/error.php b/web/routes/error/views/error.php deleted file mode 100644 index 3b926bc..0000000 --- a/web/routes/error/views/error.php +++ /dev/null @@ -1,4 +0,0 @@ -<div id="error"> - <h1><?=$title?></h1> - <span><?=$msg?></span> -</div> |