Exemplo n.º 1
0
 public function model($name)
 {
     $model = ucfirst($name) . 'Model';
     $modelPath = SITE_PATH . 'Models/' . $model . '.php';
     $modelName = '\\BasicMVC\\Models\\' . $model;
     if (is_readable($modelPath)) {
         require_once $modelPath;
         if (class_exists($modelName)) {
             $registry = Registry::getInstance();
             $registry->{$name} = new $modelName();
             return true;
         }
     }
     throw new \Exception('Model ' . $model . ' could not be loaded.');
 }
 public function __construct()
 {
     $this->_registry = Registry::getInstance();
     $this->load = new Load();
 }