CI can't find my method and I don't know why... - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: CI can't find my method and I don't know why... (/showthread.php?tid=63195) |
CI can't find my method and I don't know why... - chidiplomat - 10-05-2015 Hi all, I have a project in Ci and I can't get it to recognize my check2() for some reason. CI keeps throwing Fatal error: Call to undefined method CI_Loader::check2() controller (Login.php) PHP Code: class Login extends CI_Controller { Model (verifylogin_model.php) PHP Code: <?php Any feedback is welcome RE: CI can't find my method and I don't know why... - Narf - 10-06-2015 $this->load->model() calls don't return the models that you're requesting. http://www.codeigniter.com/userguide3/libraries/loader.html#CI_Loader::model RE: CI can't find my method and I don't know why... - slax0r - 10-06-2015 Because this is not how you use models. Method "model" of CI_Loader returns an instance of it self(CI_Loader), not an instance of the model. The model is instantiated in the controller property with the same name as the model, or in coder words: $this->Nameofmodel_model Please read: http://www.codeigniter.com/user_guide/general/models.html?highlight=model#loading-a-model |