Welcome Guest, Not a member yet? Register   Sign In
Post sheet
#2

If your using a class library then you need to access external methods using the CI Super Object.

Code:
class yourClass
{
    private $_ci;

    public function __construct()
    {
        parent:: __construct();

        $this->_ci = get_instance();
    }
}

// access db and models using $this->_ci->db->get() etc;
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
Post sheet - by juninhodeluca - 12-13-2014, 05:54 AM
RE: Post sheet - by InsiteFX - 12-13-2014, 06:59 AM
RE: Post sheet - by Narf - 12-14-2014, 08:49 AM
RE: Post sheet - by Rufnex - 12-13-2014, 07:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB