Welcome Guest, Not a member yet? Register   Sign In
issue loading model in library
#1

[eluser]gscharlemann[/eluser]
I've added a new library to my application, but I'm getting a call to member function on non-object error:
Call to a member function get_saved_races() on a non-object

Here's the new library:
Code:
class Races
{

    function Races()
    {
        $this->ci =& get_instance();
    }
    
    function get_saved_races($user_id) {
        $this->ci->load->model('race_model', 'race');
        return $this->race->get_saved_races($user_id);
    }
}
I've tried this as well with no luck:
Code:
function get_saved_races($user_id) {
        $this->ci->load->model('race_model');
        return $this->race_model->get_saved_races($user_id);
    }

I've been playing with CI long enough I thought I could figure it out, but after multiple searches and over an hour of being stuck I'm getting frustrated. Thanks for any insight.


Messages In This Thread
issue loading model in library - by El Forum - 10-10-2009, 08:30 PM
issue loading model in library - by El Forum - 10-10-2009, 09:27 PM
issue loading model in library - by El Forum - 10-10-2009, 09:37 PM



Theme © iAndrew 2016 - Forum software by © MyBB