一个简单但实用的基于PSR-14草案的事件管理器,适用于PHP >= 5.3。

1.0 2017-01-18 11:47 UTC

This package is auto-updated.

Last update: 2024-09-07 00:37:42 UTC


README

一个简单但实用的基于 PSR-14 草案的事件管理器,适用于 PHP >= 5.3。

Soochak: सूचक (通知器)

Build status Code Coverage Latest Version Downloads PHP Version License

SensioLabsInsight

安装

composer require vaibhavpandeyvpz/soochak

用法

<?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.md 文件。