Welcome Guest, Not a member yet? Register   Sign In
Objects in CI, are they ever used?
#4

A simplified summary of the way CodeIgniter works is that there is a "super object", and the loader class adds new classes as properties of that super object. That's why when you're in a controller and you load a library, you then use it with $this->.

That is one of the fundamental reasons why CI is so easy to use, but also a reason that CI is heavily criticized. "Modern" PHP frameworks will have a totally different kind of autoloading and class usage. There is nothing stopping you from autoloading this way in CI, and depending on the classes you are using, you might have to. When I use a library of some classes that require autoloading, I'll usually use Symfony's PSR4 class autoloader.
Reply


Messages In This Thread
Objects in CI, are they ever used? - by allusers - 08-19-2016, 11:43 AM
RE: Objects in CI, are they ever used? - by skunkbad - 08-23-2016, 09:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB