Events (SOLVED) - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Events (SOLVED) (/showthread.php?tid=87873) |
Events (SOLVED) - SubrataJ - 06-12-2023 Can we do this by extending Events? PHP Code: This s my CustomEvents.php file --- when I tryna trigger this by PHP Code: \CodeIgniter\Events\Events::trigger('ClientAdded'); do I have to mention all the events on Events.php? RE: Events - kenjis - 06-12-2023 You need to load your CustomEvents.php by yourself. For example, add `require 'path/to/your/CustomEvents.php';` in app/Config/Events.php. RE: Events - SubrataJ - 06-12-2023 (06-12-2023, 04:44 PM)kenjis Wrote: You need to load your CustomEvents.php by yourself. Thank you @kenjis I was thinking of this but I don't know why I didn't try. Now it's working as expected. |