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

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

aneek/slim-event-dispatcher
===========================

An event dispatcher bridge between League Event and Slim Framework.

1.0(8y ago)782.5k↓33.3%[1 issues](https://github.com/aneek/slim-event-dispatcher/issues)MITPHPPHP &gt;= 5.6

Since Sep 27Pushed 8y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (4)Versions (3)Used By (0)

Slim Event Dispatcher
=====================

[](#slim-event-dispatcher)

[![Build Status](https://camo.githubusercontent.com/9f52171c598388546db8fdcbfbecb17c364ab4914d514d2f225595d2e15fb191/68747470733a2f2f7472617669732d63692e6f72672f616e65656b2f736c696d2d6576656e742d646973706174636865722e7376673f6272616e63683d646576656c6f70)](https://travis-ci.org/aneek/slim-event-dispatcher)

This library is an implementation of `League\Event` for `Slim Framework`. This works with the latest version of Slim (V3).

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

[](#installation)

It's recommended that you use [Composer](https://getcomposer.org/) to install Slim Event Dispatcher.

```
$ composer require aneek/slim-event-dispatcher "^1.0"
```

This will install Slim Event Dispatcher and all required dependencies. This package requires PHP 5.6 or newer. Though version 1.x is not recommended for PHP 7.0 and above. The next major version (v2.x) will support PHP 7.x.

Usage
-----

[](#usage)

This is not a Slim Middleware but a package which integrates with your Slim application by extending the `SlimEventManager` class and adding it to Slim's dependency container. Currently there are two ways of integration.

### Using Class Constructor

[](#using-class-constructor)

`Slim\Event\SlimEventManager` class accepts an array argument in it's constructor and initializes all Listeners (more information on [listeners](http://event.thephpleague.com/2.0/listeners/callables/)).

The below file content serves as a application loader file for Slim Framework:

```
