Welcome Guest, Not a member yet? Register   Sign In
Return autoload.

@kierownik That is what CI4 does, with the conventional interpretation of the term "autoloader", but that is different from the CI3 "autoload" capability that the OP refers to.

@ramstudio CI4 does not have an app or controller super-object like CI3 did, which could have any number of things injected "magically", and propagated to loaded models. Making a base controller and instantiating models & libraries inside it, the "CI4 way", would help a bit - minimal inconvenience, but those properties would not be available to models or other classes.

I am not sure how practical or advisable it would be, but you could add static properties in app/Config/App, initializing them in a constructor. The result would then be "App::banana" instead of "$this->banana" (where banana is something you would have "autoloaded" in CI3). And these would be accessible anywhere inside your app.

Not sure if I am on the right track here - we'll see how this gets shot down by the community Undecided

Messages In This Thread
Return autoload. - by ramstudio - 01-07-2019, 09:04 AM
RE: Return autoload. - by kierownik - 01-07-2019, 09:39 AM
RE: Return autoload. - by ciadmin - 01-07-2019, 10:25 AM
RE: Return autoload. - by donpwinston - 01-07-2019, 10:57 AM
RE: Return autoload. - by ramstudio - 01-08-2019, 07:53 AM

Theme © iAndrew 2016 - Forum software by © MyBB