class App
{
public function __construct()
{
echo "app is now running...\n";
$this->getModel('Something');
}
public function getModel($name)
{
return new $this->getModelInstance($name);
}
protected function getModelInstance($name)
{
return 'Model_' . $name;
}
}
I have autoloader set-up and working. Why can't I load Model_Something this way, but I get the following error in return:
Notice: Undefined property: App::$getModelInstance in C:\Apache24\htdocs\ProjectName\app\App.php on line 13
Fatal error: Class name must be a valid object or a string in C:\Apache24\htdocs\ProjectName\app\App.php on line 13