A simple but useful events manager based on PSR-14 draft for PHP >= 5.3.

1.0 2017-01-18 11:47 UTC

README

A simple but useful events manager based on PSR-14 draft for PHP >= 5.3.

Soochak: सूचक (Notifier)

Build status Code Coverage Latest Version Downloads PHP Version License

SensioLabsInsight

Install

composer require vaibhavpandeyvpz/soochak

Usage

<?php

$em = new Soochak\EventManager();

// Attach a callback to 'login.success' event
$em->attach('login.success', function ($event) {
    /**
     * Perform your event logic like sending notification email
     * You can optionally stop an event from further propagation.
     */
    $event->stopPropagation(true);
});

// Anywhere in your app, trigger 'login.success' event
$em->trigger('login.success');

License

See LICENSE.md file.