ironbound/psr-14-wp

WordPress 的 PSR-14 事件实现

0.1 2019-12-28 22:53 UTC

This package is auto-updated.

Last update: 2024-08-29 05:24:00 UTC


README

非常简单的 WordPress PSR-14 事件调度器。

用法

use IronBound\Psr14WP\EventDispatcher;
use function IronBound\Psr14WP\listen;

listen( static function( Your_Event $event ) {
    // Do something with $event
} );

$event_dispatcher = new EventDispatcher();
$dispatched = $event_dispatcher->dispatch( new Your_Event() );