PHP code example of super-simple / event-dispatcher

1. Go to this page and download the library: Download super-simple/event-dispatcher library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

super-simple / event-dispatcher example snippets




// New provider
$provider = new EventProvider();

// Register listener

$provider->addListener($listener, $eventName, $priority);

// New dispatcher
$dispatcher = new EventDispatcher($provider);

// Dispatch the event
$dispatcher->dispatch($event);