GD77 Posted March 29, 2013 Share Posted March 29, 2013 Hello: I'm using the following from the controller to call a method from the model but receiving and erro: //from the controller function getT(){ $th=$this->input->post('the', TRUE); $this->model_data->thCheck($th); }//END Fn getT() //from the model function thCheck($th=NULL){ echo $th; } yet I m receiving that error:Fatal error: Call to undefined method model_Data::thCheck() in ....\controllers\main.php on line 20 Quote Link to comment https://forums.phpfreaks.com/topic/276289-codeigniter-method-error/ Share on other sites More sharing options...
Mahngiel Posted March 29, 2013 Share Posted March 29, 2013 Did you load the model into the controller? $this->load->model('model_name', 'short name'); Quote Link to comment https://forums.phpfreaks.com/topic/276289-codeigniter-method-error/#findComment-1421804 Share on other sites More sharing options...
GD77 Posted March 29, 2013 Author Share Posted March 29, 2013 the model is auto loaded in with the autoload.php Quote Link to comment https://forums.phpfreaks.com/topic/276289-codeigniter-method-error/#findComment-1421829 Share on other sites More sharing options...
GD77 Posted March 30, 2013 Author Share Posted March 30, 2013 ok fixed one error model_Data should be model_data still it wasn't case sensitive yet can t find why m getting that error... Quote Link to comment https://forums.phpfreaks.com/topic/276289-codeigniter-method-error/#findComment-1421932 Share on other sites More sharing options...
GD77 Posted April 1, 2013 Author Share Posted April 1, 2013 That s what m using whole codes... http://pastebin.com/hqAzA5x1 Quote Link to comment https://forums.phpfreaks.com/topic/276289-codeigniter-method-error/#findComment-1422219 Share on other sites More sharing options...
GD77 Posted April 1, 2013 Author Share Posted April 1, 2013 FIXED :/ can t believe I had an additional bracket at the the end of a long file wtf"}"<-- this was the problem btw as I said @pramodhkumar use autoload.php.. I had the model autoload so no need for $this->load->... Quote Link to comment https://forums.phpfreaks.com/topic/276289-codeigniter-method-error/#findComment-1422230 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.