PHP code example of moussazoungrana / event-manager

1. Go to this page and download the library: Download moussazoungrana/event-manager 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/ */

    

moussazoungrana / event-manager example snippets

 
 

 entManager\Emitter::getInstance()->on('first.event', function (){
     echo "first event \n";
 });
 
 \moz\EventManager\Emitter::getInstance()->emit('first.event');
 
 #first event
 
 
 ###########################
 
 \moz\EventManager\Emitter::getInstance()->on('second.event', function ($t){
     echo "second event here \n";
     echo $t;
 });
 
 \moz\EventManager\Emitter::getInstance()->emit('second.event', 'I am argument');
  #second event here 
  #I am argument