From 1f9024763d9224c4cd9a181bac27e6b9f12ad672 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Wed, 18 Sep 2024 14:14:53 -0400 Subject: refactor --- src/web/core/_controller.php | 54 -------------------------------------------- 1 file changed, 54 deletions(-) delete mode 100644 src/web/core/_controller.php (limited to 'src/web/core/_controller.php') diff --git a/src/web/core/_controller.php b/src/web/core/_controller.php deleted file mode 100644 index 1da5a96..0000000 --- a/src/web/core/_controller.php +++ /dev/null @@ -1,54 +0,0 @@ -load = $load; - $this->main = $this->load->model('main'); - - $this->load->lang(); - $info = $this->main->info; - $app = $info['app']; - if ($app) { - $this->load->app_lang($app); - } - } - - public function index(): void {} - - public function redirect(string $link): void { - header('Location: '. $link, true, 301); - die(); - } - - /** - * @param array $data - */ - protected function view(string $__name, array $data = array()): void { - $__root = $GLOBALS['webroot']; - $__path = $__root . '/_views/' . $__name . '.php'; - if (is_file($__path)) { - extract($data); - require($__path); - return; - } - } - - protected function error(int $code): void { - $_GET['code'] = $code; - $this->main->info['app'] = 'error'; - $error_controller = $this->load->controller('error'); - $error_controller->index(); - die(); - } - -} -- cgit v1.2.3-freya