lemonphp/event
最新稳定版本:v1.0.0
Composer 安装命令:
composer require lemonphp/event
包简介
Simple event dispatcher
README 文档
README
A simple event dispatcher
Usage
use Lemon\Event\Event;
use Lemon\Event\EventDispatcher;
$dispatcher = new EventDispatcher();
// Add listener (listener is callable with event object as argument)
$dispatcher->addListener('event.type', function(Event $event) {
echo $event->getEventType() . ' is fired';
});
// Add subscriber (subscriber is implemented by yourself)
$dispatcher->addSubscriber($subscriber);
$dispatcher->dispatch('event.type');
Changelog
See all change logs in CHANGELOG.md
Contributing
All code contributions must go through a pull request and approved by a core developer before being merged. This is to ensure proper review of all the code.
Fork the project, create a feature branch, and send a pull request.
To ensure a consistent code base, you should make sure the code follows the PSR-2.
If you would like to help take a look at the list of issues.
License
This project is released under the MIT License.
Copyright © 2015-2016 LemonPHP Team.
统计信息
- 总下载量: 126.56k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-12-30