Introduction to CodeIgniter 4 Blog Posts |
(06-04-2018, 01:26 PM)cosmo Wrote: Are Services in CI4 the same thing as Facades in Laravel? Good question. And you know, I hadn't really made the connection between how close those appeared until you mentioned it. Short answer is No. Services are simple methods that the framework provides (and you can easily create) that will build an instance of a class for you, taking care of injecting the appropriate dependencies, etc. It's closer to a factory class than anything else, I would say. They are used to help you use Dependency Injection in a simple, flexible, explicit manner. We use it in place of a DI Container that handles things magically for you. It was heavily inspired by this blog post by Anthony Ferrara. |
Welcome Guest, Not a member yet? Register Sign In |