diff options
author | Freya Murphy <freya@freyacat.org> | 2024-03-29 22:29:56 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2024-03-29 22:29:56 -0400 |
commit | 944b6b0526032ad8c1b4a2612d6723bec75e0e4c (patch) | |
tree | d3da5584df33a7878c087622b4fc2ec2883cf880 /web/core/model.php | |
download | xssbook2-944b6b0526032ad8c1b4a2612d6723bec75e0e4c.tar.gz xssbook2-944b6b0526032ad8c1b4a2612d6723bec75e0e4c.tar.bz2 xssbook2-944b6b0526032ad8c1b4a2612d6723bec75e0e4c.zip |
start database (user and post), and initial barebones home page
Diffstat (limited to '')
-rw-r--r-- | web/core/model.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/web/core/model.php b/web/core/model.php new file mode 100644 index 0000000..039b138 --- /dev/null +++ b/web/core/model.php @@ -0,0 +1,29 @@ +<?php /* Copyright (c) 2024 Freya Murphy */ +abstract class Model { + // the main model + // shared by all controllers and models + public $main; + public $load; + + // the database + public $db; + + private $config; + + function __construct() { + $this->main = $GLOBALS['__vars']['main']; + $this->load = $GLOBALS['__vars']['load']; + $this->db = $this->main->db; + $this->config = new Aesthetic(); + } + + public function get_data() { + $data = array(); + $route = $this->main->info['route']; + $files = $this->config->get_files($route); + $data = array_merge($data, $files); + $data['self'] = $this->main->user(); + return $data; + } +} +?> |