I am using this name space
use \App\Model\PostsModel;
and i am trying to access the class like this in another class :
public $model = PostsModel::class;
the out put of vardump
is "App\Model\PostsModel" and vardump
shows that the type of it is string.
I have searched a lot, but I couldn't find how to cast/convert string into stdclass. This is what I have tried:
$model = \App\Model\PostsModel;
I also tried to get a instance of it
public $model = new \App\Model\PostsModel;
public $model = new PostsModel::class;
My vardump is:
vardump($this->model);
which shows that my namespace addresses are correct