• 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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.
Support Development  • Practical CodeIgniter 3  • Vulcan - CLI Tools for CI4

Messages In This Thread
RE: Introduction to CodeIgniter 4 Blog Posts - by kilishan - 06-04-2018, 01:38 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.