PHPackages                             trunda/smf-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. trunda/smf-events

ActiveNette-addon[Utility &amp; Helpers](/categories/utility)

trunda/smf-events
=================

Central event dispatcher for Nette

09PHP

Since Jul 23Pushed 12y ago1 watchersCompare

[ Source](https://github.com/trunda/SmfEvents)[ Packagist](https://packagist.org/packages/trunda/smf-events)[ RSS](/packages/trunda-smf-events/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

SmfEvents is central event dispatching system for Nette framework. It is strongly based on symfony 2 event dispatcher

\#Installation

Easiest way to install the addon is via `composer`. Add this to your `composer.json`:

```
"trunda/smf-events": "1.0.*@dev",

```

and then register the extension by adding this line to your `bootstrap.php` before container creation:

```
Smf\Events\Config\Extension::register($configurator);
```

The dispatcher
--------------

[](#the-dispatcher)

The event dispatcher is central container holding all listeners and also dispatches all events to their listeners.

```
use Smf\Events\EventDispatcher;

$dispatcher = new EventDispatcher();
```

Adding listeners
----------------

[](#adding-listeners)

If you want to listen particular event, you need to register the listener. It is done by `addListener` method, which takes event name as the first argument and valid PHP callback as the second one.

```
$listener = new SomeClass();
// this class has method onFooAction which takes Event instance as argument

$dispatcher->addEventListener('fooAction', array($listener, 'onFooAction'));
```

Method `addListener` can take 3 arguments

1. The event name that the listener wants to listen to
2. A valid [PHP callback](http://www.php.net/manual/en/language.pseudo-types.php#language.types.callback) that will be called whenever the event is triggered
3. A priority which is gives you availability to sort event dispatching (event with higher priority will be dispatched earlier)

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/466388?v=4)[Jakub Truneček](/maintainers/trunda)[@trunda](https://github.com/trunda)

---

Top Contributors

[![trunda](https://avatars.githubusercontent.com/u/466388?v=4)](https://github.com/trunda "trunda (2 commits)")

### Embed Badge

![Health badge](/badges/trunda-smf-events/health.svg)

```
[![Health](https://phpackages.com/badges/trunda-smf-events/health.svg)](https://phpackages.com/packages/trunda-smf-events)
```

###  Alternatives

[brightnucleus/geolite2-country

Composer-packaged version of the free MaxMind GeoLite2 Country database.

2318.0k](/packages/brightnucleus-geolite2-country)[rareloop/lumberjack-bedrock-installer

101.6k1](/packages/rareloop-lumberjack-bedrock-installer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
