CodeIgniter Forums
Load libraries from a subfolder - 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: Load libraries from a subfolder (/showthread.php?tid=8811)



Load libraries from a subfolder - El Forum - 06-01-2008

[eluser]mattalexx[/eluser]
How do I load libraries from a subfolder of application/libraries?


Load libraries from a subfolder - El Forum - 06-01-2008

[eluser]Pascal Kriete[/eluser]
Currently isn't possible without making changes to the loader. Sorry.


Load libraries from a subfolder - El Forum - 06-01-2008

[eluser]mattalexx[/eluser]
What are the cons of just using require_once to load my own classes? If I go that route, would it be better practice to put my files somewhere else other than in "libraries"? If so, where should I put them?


Load libraries from a subfolder - El Forum - 06-01-2008

[eluser]Pascal Kriete[/eluser]
They won't automatically be tied to the CI super-object (so no $this->whatever), and the config files won't be autoloaded. I think that's the only two.

You can still put them in libraries (APPPATH.'libraries/myfolder/myclass'.EXT) or make your own folder parallel to the libraries folder (APPPATH.'my_libraries/myfolder/myclass'.EXT).


Load libraries from a subfolder - El Forum - 06-01-2008

[eluser]mattalexx[/eluser]
Thanks for your help. I'm learning this fast-- I can't believe how small that learning curve is on this!