Welcome Guest, Not a member yet? Register   Sign In
how to get the instance of the calling controller from a custom library
#1

[eluser]jayapalchandran[/eluser]
I have a general library.
from there i want to access the called controllers this object.
How do i do that.

Code:
var $db;
$CI =& get_instance();
$this->par = $CI;
$this->db =& $CI->db;

//i am using like
$this->par->load->view('home/contact');


if i do $this = $CI then i cannot access the current general.php libraries functions...

so, is there any other option? or is the above the only option?

If this question has been already asked then if i could get that link then i will go through that. if you would like to reply then no problem i will also follow those points.




Theme © iAndrew 2016 - Forum software by © MyBB