OK, what I'm trying to do is do something so that I can call it $this->model->users->getInfomation('name'); or something similar in my structure but php gives me strict standards Creating a default object from an empty value
protected function model($model) { $path = "features". DS ."models". DS . $model .".php"; require $path; $class = 'Model'. ucfirst($model); $this->model->$model = new $class; }
can we do it so that it somehow complies with the standards?
change *
this function is in the Application class, so I can extend them from our controller as a blog Extends the application and then calls something like $ this-> model-> blog will get something like what I do above when I do something like
protected function model($model) { $path = "features". DS ."models". DS . $model .".php"; require $path; $class = 'Model'. ucfirst($model); $this->$model = new $class; }
yes, the code above works fine $this->blog->getSomething(); , but for some reason I want to make them in a group, for example, above, so if we want to get something like $this->model->blog->getSomething();
Thanks for the time.
Adam Ramadhan
Adam ramadhan
source share