File size: 503 Bytes
235bfe8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
    class Controller{
        public function __construct(){

        }

        public function model($model){
            require_once('../app/models/' . $model . '.php');

            return new $model();
        }

        public function view($view, $data = []){
            if (file_exists('../app/views/' . $view . '.php')) {
                require_once('../app/views/' . $view . '.php');
            }
            else{
                die('View not found');
            }
        }
    }