Welcome Guest, Not a member yet? Register   Sign In
Confusion calling model functions
#6

[eluser]TheFuzzy0ne[/eluser]
Just a few observations:

Your model's file name should be lower case, and the model name you pass to the loader should also be lowercase.

If you're extending MY_Controller, you should make a call to parent::MY_Controller(), not parent::Controller().

As Jedd suggested, those names are quite confusing. My solution is to append model names with "_model". So you file would be called post_model.php, the class would be defined as Post_model, and you'd access it using $this->post_model->get(), or whatever. This helps make it clear that you are accessing a model, as opposed to a library.

Lose the camel case. There's just no need for it... Wink

If that method is still non-existent, then there's a good chance you're constructor isn't being called. You can confirm by simply adding a die() within the constructor.

Just my 2 pence. Smile


Messages In This Thread
Confusion calling model functions - by El Forum - 06-27-2009, 02:13 AM
Confusion calling model functions - by El Forum - 06-27-2009, 02:29 AM
Confusion calling model functions - by El Forum - 06-27-2009, 03:23 AM
Confusion calling model functions - by El Forum - 06-27-2009, 05:12 AM
Confusion calling model functions - by El Forum - 06-27-2009, 01:09 PM
Confusion calling model functions - by El Forum - 06-27-2009, 02:15 PM
Confusion calling model functions - by El Forum - 06-27-2009, 02:40 PM
Confusion calling model functions - by El Forum - 06-27-2009, 02:48 PM
Confusion calling model functions - by El Forum - 06-27-2009, 02:52 PM
Confusion calling model functions - by El Forum - 06-27-2009, 03:06 PM
Confusion calling model functions - by El Forum - 06-27-2009, 03:41 PM
Confusion calling model functions - by El Forum - 06-27-2009, 04:07 PM
Confusion calling model functions - by El Forum - 06-27-2009, 04:58 PM
Confusion calling model functions - by El Forum - 06-27-2009, 05:23 PM
Confusion calling model functions - by El Forum - 06-27-2009, 05:33 PM



Theme © iAndrew 2016 - Forum software by © MyBB