summaryrefslogtreecommitdiff
path: root/web/core/model.php
blob: 039b138737af60edea9812a10e8118bfb7182423 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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;
	}
}
?>