/var/www/doncode.com.ua/www/libs
Edit: /var/www/doncode.com.ua/www/libs/class.controller.php (1116B)
view = new view();
}
public function loadModel($name,$c=false){
$path = "models/class." . $name . "_model.php";
if (file_exists($path)) {
require_once $path;
$modelName = $name . '_model';
if(!$c){
$this->model = new $modelName();
$this->view->perm = $this->model->getPerm();
$this->view->user_exchanges = $this->model->getUserExchanges();
}else{
$this->_collection[$name]=new $modelName();
}
}else{
throw new Exception ("Error: Not found file $path");
}
}
public function getCollection ($name){
if(isset($this->_collection[$name])){
return $this->_collection[$name];
}else{
throw new Exception ("Error: Not found models $name");
}
}
}
?>