At this time I start to build a MVC framework (PHP). Everything is going fine but now I got a problem :
Notice: Undefined property: welcome::$users in C:\wamp\www\framework\application\controllers\welcome.php on line 17
this is the second error
Fatal error: Call to a member function member() on a non-object in C:\wamp\www\framework\application\controllers\welcome.php on line 17
this is my model
class users extends Model {
function __construct() {
$this->db_type = new mysql_database();
}
public function member(){
}
}
this is my controller
class welcome extends Controller{
public function index(){
$this->model('users');
$this->users->member();
}
}
this is my base controller
abstract class Controller {
public function model($model_name) {
$model_path = APP_PATH . 'models' . '/' . $model_name . EXT;
if (file_exists($model_path)) {
require_once $model_path;
if (class_exists($model_name))
$model_name = new $model_name();
return $model_name;
}
}
}
what is the solution of this error thanks