Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter4 - Event listner
#3

Events replaced CodeIgniter's Hooks system with something a little more flexible.

Can it be used like Laravel's? Sure.

What are the benefits of using it? That's up to the developer of course. In many cases, you might prefer not to use them but to use something more explicit. In bigger teams, you might have one developer working on a feature and they expose an event whenever X happens. Other team members can tap into that to do things like fire off a notification that inventory dropped to zero, or send a webhook to third parties, or whatever. Library developers can use it as hooks into their own code, etc.

It's there if you want it, but not required to use for anything. However, the amount of memory used by it is pretty minimal just to store the closures that will get triggered.
Reply


Messages In This Thread
CodeIgniter4 - Event listner - by happyape - 09-19-2018, 03:21 AM
RE: CodeIgniter4 - Event listner - by Pertti - 09-19-2018, 03:58 AM
RE: CodeIgniter4 - Event listner - by kilishan - 09-19-2018, 05:38 AM
RE: CodeIgniter4 - Event listner - by happyape - 09-19-2018, 05:48 AM
RE: CodeIgniter4 - Event listner - by Pertti - 09-19-2018, 06:01 AM
RE: CodeIgniter4 - Event listner - by Pertti - 09-19-2018, 05:54 AM
RE: CodeIgniter4 - Event listner - by happyape - 09-19-2018, 06:03 AM
RE: CodeIgniter4 - Event listner - by Pertti - 09-19-2018, 06:40 AM
RE: CodeIgniter4 - Event listner - by unodepiera - 09-29-2018, 11:47 AM
RE: CodeIgniter4 - Event listner - by happyape - 09-29-2018, 12:38 PM
RE: CodeIgniter4 - Event listner - by unodepiera - 09-29-2018, 11:29 PM
RE: CodeIgniter4 - Event listner - by abrkof - 01-04-2020, 10:31 AM
RE: CodeIgniter4 - Event listner - by InsiteFX - 01-05-2020, 09:35 AM



Theme © iAndrew 2016 - Forum software by © MyBB