initphp/event-emitter
最新稳定版本:1.0
Composer 安装命令:
composer require initphp/event-emitter
包简介
PHP Event Emitter
README 文档
README
This library has been designed to emit events in its simplest and simplest form.
Requirements
- PHP 5.6 or higher
Installation
composer require initphp/event-emitter
or Manuel Installation :
Download this repository. And include the src/Init.php file in your project.
Usage
require_once "vendor/autoload.php"; use InitPHP\EventEmitter\EventEmitter; $events = new EventEmitter(); $events->on('hello', function ($name) { echo 'Hello ' . $name . '!' . PHP_EOL; }, 99); $events->on('hello', function ($name) { echo 'Hi ' . $name . '!' . PHP_EOL; }, 10); // Emit $events->emit('hello', ['World']);
Output :
Hi World!
Hello World!
Credits
License
Copyright © 2022 MIT License
统计信息
- 总下载量: 120
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-07-09