![]() |
I'm migrating a CI3 app to CI4, so naturally that means converting the hooks to events.
I have the following in app/Config/Events.php: PHP Code: Events::on('post_controller_constructor', ['Load_config', 'load_config']); In app/Events/Load_config.php I have: PHP Code: <?php But when I load the application I'm greeted with "Error Class 'Load_config' not found". I'm assuming that this means that the event loader is not looking where I'm expecting it to look. A couple of questions come up: - Where should classes formerly in the hooks folder be kept? - Am I missing a reference in my event call that would cause the event loader to look in app/Events/ to find the class? I thought namespacing the class would take care of that, but perhaps I'm mistaken. |
Messages In This Thread |
Class not found error with events - by objecttothis - 11-18-2022, 03:57 AM
RE: Class not found error with events - by kenjis - 11-18-2022, 05:09 AM
RE: Class not found error with events - by objecttothis - 11-20-2022, 10:04 AM
RE: Class not found error with events - by kenjis - 11-20-2022, 02:59 PM
|