PHP code example of mulertech / event-manager

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

    

mulertech / event-manager example snippets


use Muler\EventManager\EventManager;

$eventManager = new EventManager();

$eventManager->addListener(new Listener());

// Into the class that calls the event
$eventManager->dispatch(new Event());

use Muler\EventManager\ListenerInterface;

class Listener implements ListenerInterface
{
    public function handle(Event $event)
    {
        // Do something
    }
}

php composer.phar update