1
0
Fork 0
oldhaven/php/core/classes/mvc/Model.class.php

18 lines
333 B
PHP

<?php
class Model {
protected $db;
public function __construct() {
$this->db = Db::getInstance();
}
public static function factory($package, $model) {
require_once ROOT_DIR .'/app/'. $package .'/models/'. $model .'.class.php';
$class_name = ucfirst($package) .'_'. $model .'Model';
return new $class_name();
}
}
?>