elephox / events
Elephox 事件库。
v0.7.0
2022-09-09 21:40 UTC
Requires
- php: ^8.1 <8.3
- elephox/collection: dev-develop
- jetbrains/phpstorm-attributes: ^1.0
- dev-develop
- 0.9.0.x-dev
- 0.8.0.x-dev
- v0.7.0
- v0.6.0
- v0.5.0
- v0.4.3
- 0.4.0
- 0.4.0-alpha5
- 0.4.0-alpha4
- 0.4.0-alpha3
- 0.4.0-alpha2
- 0.4.0-alpha1
- 0.3.27
- v0.3.25
- v0.3.24
- v0.3.23
- v0.3.22
- v0.3.21
- v0.3.20
- v0.3.18
- v0.3.17
- v0.3.16
- v0.3.15
- v0.3.14
- v0.3.13
- v0.3.12
- v0.3.11
- v0.3.10
- v0.3.9
- v0.3.8
- v0.3.7
- v0.3.6
- v0.3.5
- v0.3.4
- dev-release/0.9
- dev-release/0.8
- dev-release/0.7
- dev-release/0.6.0
- dev-16-psr-20-clock
- dev-18-make-servicecollection-more-extensible
- dev-release/0.6
- dev-release/0.5
- dev-release/0.4
- dev-release/0.3
This package is auto-updated.
Last update: 2024-09-05 17:55:27 UTC
README
此模块由 Elephox 使用,以提供带有广播器和监听器的事件总线。
示例
<?php use Elephox\Events\EventBus; $bus = new EventBus(); $subscription = $bus->subscribe('test', function ($data) { echo 'test event: ' . $data; }); $bus->publish('test', 'test data'); // "test event: test data" $bus->unsubscribe($subscription); $bus->publish('test', 'test data'); // no output