Welcome Guest, Not a member yet? Register   Sign In
Problem: Can't call a model function in my library!
#1

[eluser]Jason van der Zeeuw[/eluser]
Hey all,

Here is my problem code:

Code:
var $CI; //Contains an instance of the library

    public function __construct() {
        $this->CI = & get_instance();
        $this->CI->load->model('mymodel');        
    }

    function test()
    {        
        return $this->mymodel->testmethod());
    }

I get 2 errors:

Message: Undefined property: My_library::$mymodel (so he doesn't knows 'mymodel')
&
Fatal error: Call to a member function testmethod() on a non-object


Messages In This Thread
Problem: Can't call a model function in my library! - by El Forum - 05-03-2012, 04:10 AM
Problem: Can't call a model function in my library! - by El Forum - 05-03-2012, 04:31 AM
Problem: Can't call a model function in my library! - by El Forum - 05-03-2012, 04:33 AM
Problem: Can't call a model function in my library! - by El Forum - 05-03-2012, 04:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB