3 class index
extends model
{
5 public $exhibits = array();
6 public $projects = array();
8 public function __construct() {
10 $this->fetch_exhibits();
11 $this->fetch_projects();
14 public function display() {
15 require_once("view/index.php");
18 private function fetch_exhibits() {
19 $sql = "SELECT text FROM projects ORDER BY rank";
20 $result = $this->db
->query($sql);
21 while ($entry = $result->fetch_object()) {
22 $this->exhibits
[] = $entry->text
;
26 private function fetch_projects() {
27 $sql = "SELECT title FROM projects ORDER BY rank";
28 $result = $this->db
->query($sql);
29 while ($entry = $result->fetch_object()) {
30 $this->projects
[] = $entry->title
;