CodeIgniter Forums
loader class and main controller - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: loader class and main controller (/showthread.php?tid=46659)



loader class and main controller - El Forum - 11-10-2011

[eluser]miauksius[/eluser]
Hello,

I'm making a college project now, and the project is to make a website. I thought that I should write myself a very tiny codeigniter version, but I'm pretty new to PHP OOP. I want to be able load my classes for database management from controller (with $this->load->library('DB')Wink, and reach it from my controller with $this->DB->function(); now, I don't understand how do I assign from my loader class to controller class variable DB and set a DB class to it? I've been reading about relationship between classes, but didn't find what I need Sad