taller-mvc / mvc /app /libs /Controller.php
ladogton2010's picture
Test Controller class
235bfe8
raw
history blame contribute delete
503 Bytes
<?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');
}
}
}