![]() |
Php class - 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: Php class (/showthread.php?tid=44069) |
Php class - El Forum - 08-01-2011 [eluser]nuclearmaker[/eluser] hi, i want to create the some CI library, so here is my code. but 2 diff method, i need to call the instance again.is there a way to call once only? Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); Php class - El Forum - 08-02-2011 [eluser]LuckyFella73[/eluser] I guess you have to load the library in your class contructor: Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); Php class - El Forum - 08-02-2011 [eluser]danmontgomery[/eluser] Libraries in CI are just classes, why not stick it in the libraries folder and use the loader? Code: class Yourclass |