PHPackages                             mildabre/event-dispatcher - 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. mildabre/event-dispatcher

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mildabre/event-dispatcher
=========================

Simple event dispatcher for Nette based applications.

v0.1.1(2mo ago)00MITPHPPHP &gt;=8.1

Since Feb 14Pushed 2mo agoCompare

[ Source](https://github.com/mildabre/event-dispatcher)[ Packagist](https://packagist.org/packages/mildabre/event-dispatcher)[ RSS](/packages/mildabre-event-dispatcher/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

Event Dispatcher
================

[](#event-dispatcher)

[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)[![PHP Version](https://camo.githubusercontent.com/7663c9d53dc13cedaf0660a8745a7e77d2dd711257f36aa86ebce12a0600ef42/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e312d626c75652e737667)](https://www.php.net/)

Simple, fresh, and modern event dispatcher with attribute-based event listener registration for Nette Framework applications.

Features
--------

[](#features)

- **Attribute-based registration** - Use PHP 8 attributes to mark events and listeners
- **Simple API** - Minimal configuration, maximum productivity
- **Nette DI integration** - Seamless integration with Nette Dependency Injection
- **Lightweight** - No bloat, just what you need
- **Event Listener Discovery** - Automatic listener registration

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

[](#installation)

Install via Composer:

```
composer require mildabre/event-dispatcher
```

Configuration
-------------

[](#configuration)

Register the extension in your `common.neon`:

```
extensions:
    events: Mildabre\EventDispatcher\DI\EventDispatcherExtension
```

Optional dispatch disabling:

```
events:
    enabled: false       # default: true
```

Define an Event
---------------

[](#define-an-event)

Create an event as value object (final readonly class) with class and mark it with the `#[Event]` attribute.

```
