How to get class reference - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: How to get class reference (/showthread.php?tid=2078) |
How to get class reference - El Forum - 07-15-2007 [eluser]mezoni[/eluser] I want have a reference a class in class constructor. By example. Code: class Test extends Controller But CI create object like this. Code: $CI = new $class(); If I use reference in class constructor I have copy of object but not reference. if this were so... Code: $CI =& new $class(); ...then this will be possible. But I don't know how to get class reference from class constructor. I there any way to do this? How to get class reference - El Forum - 07-15-2007 [eluser]Glen Swinfield[/eluser] Assuming php5: Code: class Test extends Controller |