From 8a2c577823b69117af8eda9b1a46bfbcae8153c6 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Mon, 8 Jul 2024 17:22:30 -0400 Subject: a few fixes, just a few.... --- src/web/core/_controller.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/web/core/_controller.php') 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 $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'); -- cgit v1.2.3-freya