Welcome Guest, Not a member yet? Register   Sign In
Having database access in 3rd party lib
#2

Look here: http://www.codeigniter.com/userguide3/ge...ur-library

Soo.. for example:


PHP Code:
class extLib3 {
  
    
private $ci;

    public function __construct() 
    {
        //Getting CI instance (the =& is important and not a typo, because you want the original, not a copy (assigning by reference))
        $this->ci =& get_instance();

        //Load database
        $this->ci->load->database();
    }

-.-.-.-.-.-.-.-.- Angel -.-.-.-.-.-.-.-.-
Reply


Messages In This Thread
RE: Having database access in 3rd party lib - by Urastor - 05-06-2015, 04:29 PM



Theme © iAndrew 2016 - Forum software by © MyBB