PHPackages                             comphp/events - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. comphp/events

Abandoned → [comphp/runtime](/?search=comphp%2Fruntime)ArchivedLibrary[Utility &amp; Helpers](/categories/utility)

comphp/events
=============

A lightweight, modular event dispatcher with PSR-14 compatibility and an object-oriented approach for registering and triggering events.

v0.2(1y ago)162MITPHPPHP ^8.4

Since Feb 17Pushed 1y agoCompare

[ Source](https://github.com/commonphp/events)[ Packagist](https://packagist.org/packages/comphp/events)[ RSS](/packages/comphp-events/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (2)Versions (3)Used By (2)

CommonPHP Events
================

[](#commonphp-events)

A lightweight, PSR-14 compatible event dispatching library designed for simplicity and efficiency. It provides a global yet replaceable event dispatcher, supports prioritized listeners, and allows flexible event handling.

Features
--------

[](#features)

- **PSR-14 Compatible:** Implements the standard event dispatcher interface.
- **Simple Event Registration:** Easily register and dispatch events.
- **Prioritized Listeners:** Control execution order with priority levels.
- **Global or Dependency Injected:** Use globally or inject as needed.
- **Supports Stoppable Events:** Halt propagation when necessary.

Installation
------------

[](#installation)

Install via Composer:

```
composer require comphp/events
```

Usage
-----

[](#usage)

Create and dispatch events using the `EventDispatcher`.

```
