CI classes + custom library - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: CI classes + custom library (/showthread.php?tid=15126) |
CI classes + custom library - El Forum - 01-27-2009 [eluser]rvent[/eluser] Hello, I've read the docs, but got a quick question about CI classes. In the docs it mentions that to be able to use them you need to do: Code: $CI =& get_instance(); so in order to load up my model i would have to do that in every function i need them...? Or could i just put it in a constructor..? Code: function _Class() And technically access the model with $this->MyModel->something()...? am i correct and way off..? Thanks CI classes + custom library - El Forum - 01-27-2009 [eluser]rvent[/eluser] It would be: $this->CI->MyModel->something(). |