Welcome Guest, Not a member yet? Register   Sign In
CI4: How to autoload libraries like Database, Session etc
#4

Autoloading it like you're thinking of from CI3 isn't really a thing anymore, but it's simple to handle yourself. If you find that you need the same libs loaded every time, you can make a BaseController that all of your other controllers extend from. And you can load it from there.

Many times, though, you can simple get the class through Services, as puschie pointed out, whenever you need it. Session doesn't need to be loaded before you need it, though, as the first time it is used it will automatically be initialized.
Reply


Messages In This Thread
RE: CI4: How to autoload libraries like Database, Session etc - by kilishan - 11-14-2018, 06:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB