objective-php/events-handler
最新稳定版本:v3.1.0
Composer 安装命令:
composer require objective-php/events-handler
包简介
Events Handler for ObjectivePHP
README 文档
README
Library topic
Simple events handler meant to work together with our objective-php/matcher.
It allows to bind events using patterns as defined in Matcher documentation (using wildcards and alternatives...)
Concept
Nothing really new here from the events handling point of view. The real specific feature is more related to the way the callbacks are bound to events, thanks to Matcher.
Usage
Callback binding
Binding a callback to an event is quite straight forward:
$eventsHandler = new EventsHandler(); $eventsHandler->bind('event.name', function($event) { echo 'Event ' . $event->getName() . ' was just fired!'); } );
Event triggering
Once again, this is very simple:
$eventsHandler->trigger('event.name'); // will echo 'Event event.name was just fired!'
More documentation to come soon!
统计信息
- 总下载量: 123.69k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2015-05-19