Welcome Guest, Not a member yet? Register   Sign In
class include
#4

[eluser]xinq88[/eluser]
Great, the library functionality does pretty much what I need. Could've known this by reading the manual one more time Tongue.

Still one more problem. As I said, I loaded the database library automatic (in the autoload.php).
When I use a library for my Uur class it doesn't know this library. There's the problem because when I try to load it in the constructor of the class it gives me an error.

Code:
function Uur()
    {    
        $this->load->database();
    }

results in:

Code:
Fatal error: Call to a member function database() on a non-object

When I don't load it at all, the function "return $this->db->get('uren');" returns the following message:

Code:
Call to a member function get() on a non-object in

I have no idea how to do this on the CI way, maybe you can point me in the right direction.

Thank you for your help!

edit:
Code:
function __construct()
    {    
        $this->CI = &get;_instance();
    }

this works for me but is there a way of doing this for all libraries at the same time so I don't have to implement that in every library? Something like what an autoload is for a constructor?


Messages In This Thread
class include - by El Forum - 09-23-2008, 12:47 PM
class include - by El Forum - 09-24-2008, 11:14 AM
class include - by El Forum - 09-24-2008, 11:20 AM
class include - by El Forum - 09-24-2008, 12:56 PM
class include - by El Forum - 10-03-2008, 11:26 AM
class include - by El Forum - 10-05-2008, 07:02 AM



Theme © iAndrew 2016 - Forum software by © MyBB