PHP code example of rudra / event-dispatcher

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

    

rudra / event-dispatcher example snippets


use Rudra\Container;
use Rudra\EventDispatcher;
use Rudra\Interfaces\ContainerInterface;

$rudra = Container::app();

$services = [
    'contracts' => [
        ContainerInterface::class => $rudra,
    ],
    
    'services' => [
        // Another services
        
        'event.dispatcher' => ['Rudra\EventDispatcher'],
        
        // Another services
    ]
];

$rudra->setServices($services);