Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter4 - Event pass by ???
#2

I figured I could simply extend the Events Class to add this feature (https://bcit-ci.github.io/CodeIgniter4/e...re-classes) but it looks like this library is autoloaded using the PSR4 classmap array. 

Simply adding:


PHP Code:
$classmap = [
 ...
 
'CodeIgniter\Events\Events' => APPPATH 'Libraries/Events.php',
 ...
]; 

to the configuration file Autoload (/application/Config/Autoload.php)

causes a issue because when I extend \CodeIgniter\Events\Events with my Events class


PHP Code:
<?php 

namespace App\Libraries;

class Events extends \CodeIgniter\Events\Events {




It can't find \CodeIgniter\Events\Events because the /application/Config/Autoload.php classmap already points to my new APPPATH . 'Libraries/Events.php' file?

How would one extend the Events or really any class which users are loading using the 


PHP Code:
use CodeIgniter\Events\Events

Syntax?

DMyers
Reply


Messages In This Thread
CodeIgniter4 - Event pass by ??? - by dmyers - 10-01-2018, 08:41 AM
RE: CodeIgniter4 - Event pass by ??? - by dmyers - 10-02-2018, 06:57 AM
RE: CodeIgniter4 - Event pass by ??? - by falko - 10-02-2018, 01:00 PM
RE: CodeIgniter4 - Event pass by ??? - by dmyers - 10-03-2018, 06:18 AM
RE: CodeIgniter4 - Event pass by ??? - by dmyers - 10-03-2018, 11:43 AM
RE: CodeIgniter4 - Event pass by ??? - by dmyers - 10-03-2018, 12:38 PM
RE: CodeIgniter4 - Event pass by ??? - by dmyers - 10-08-2018, 07:55 AM
RE: CodeIgniter4 - Event pass by ??? - by abrkof - 01-04-2020, 09:41 AM



Theme © iAndrew 2016 - Forum software by © MyBB