diff options
author | Freya Murphy <freya@freyacat.org> | 2024-07-08 17:22:30 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2024-07-08 17:22:30 -0400 |
commit | 8a2c577823b69117af8eda9b1a46bfbcae8153c6 (patch) | |
tree | e89dee0f77377a665c78d8a3cea6012888d9af73 /src/web/core/_controller.php | |
parent | fix2 (diff) | |
download | website-8a2c577823b69117af8eda9b1a46bfbcae8153c6.tar.gz website-8a2c577823b69117af8eda9b1a46bfbcae8153c6.tar.bz2 website-8a2c577823b69117af8eda9b1a46bfbcae8153c6.zip |
a few fixes, just a few....
Diffstat (limited to 'src/web/core/_controller.php')
-rw-r--r-- | src/web/core/_controller.php | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/web/core/_controller.php b/src/web/core/_controller.php index 0dbb5b8..1da5a96 100644 --- a/src/web/core/_controller.php +++ b/src/web/core/_controller.php @@ -2,10 +2,10 @@ abstract class Controller { // the main model - public $main; + public Main_model $main; // the loader - public $load; + public Loader $load; /** * Creates a constructor @@ -23,14 +23,17 @@ abstract class Controller { } } - public function index() {} + public function index(): void {} - public function redirect($link) { + public function redirect(string $link): void { header('Location: '. $link, true, 301); die(); } - protected function view($__name, $data = array()) { + /** + * @param array<int,mixed> $data + */ + protected function view(string $__name, array $data = array()): void { $__root = $GLOBALS['webroot']; $__path = $__root . '/_views/' . $__name . '.php'; if (is_file($__path)) { @@ -40,7 +43,7 @@ abstract class Controller { } } - protected function error($code): void { + protected function error(int $code): void { $_GET['code'] = $code; $this->main->info['app'] = 'error'; $error_controller = $this->load->controller('error'); |