PHP code example of objective-php / events-handler

1. Go to this page and download the library: Download objective-php/events-handler 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/ */

    

objective-php / events-handler example snippets


$eventsHandler = new EventsHandler();
$eventsHandler->bind('event.name', function($event) { 
    echo 'Event ' . $event->getName() . ' was just fired!');
    }
  );

$eventsHandler->trigger('event.name'); // will echo 'Event event.name was just fired!'