Welcome Guest, Not a member yet? Register   Sign In
Events (SOLVED)
#1
Big Grin 
(This post was last modified: 06-12-2023, 10:57 PM by SubrataJ.)

Can we do this by extending Events?
PHP Code:
This s my CustomEvents.php file ---
<?
php
namespace App\Events;
use 
CodeIgniter\Events\Events;
use 
App\Hooks\ProviderHooks;
$pHooks = new ProviderHooks();
// // Events::on('clientAdded', static function ($foo, $bar, $baz) {
// //    echo 'Hola Amigos';
// // });

Events::on("ClientAdded", [$pHooks"clientAdded"]); 

when I tryna trigger this by  
PHP Code:
\CodeIgniter\Events\Events::trigger('ClientAdded'); 
it's not working unless I define these events in Event.php

do I have to mention all the events on Events.php?
Learning Codeigniter 
Reply


Messages In This Thread
Events (SOLVED) - by SubrataJ - 06-12-2023, 05:16 AM
RE: Events - by kenjis - 06-12-2023, 04:44 PM
RE: Events - by SubrataJ - 06-12-2023, 10:56 PM



Theme © iAndrew 2016 - Forum software by © MyBB