summaryrefslogtreecommitdiff
path: root/src/web/core/_controller.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/web/core/_controller.php')
-rw-r--r--src/web/core/_controller.php15
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');