2017 © Pedro Peláez
 

library eveniment

Eveniment is a simple event dispatching PHP library

image

eveniment/eveniment

Eveniment is a simple event dispatching PHP library

  • Thursday, June 9, 2016
  • by iosifch
  • Repository
  • 0 Watchers
  • 0 Stars
  • 24 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Eveniment

Eveniment is a simple event dispatcher library for PHP. It's highly inspired by igorw/evenement library., (*1)

Build Status, (*2)

Install

Eveniment can be installed via composer running the command below:, (*3)

composer require eveniment/eveniment

Or fetching from the Github repository:, (*4)

git clone git@github.com:iosifch/eveniment.git

Test

Just run vendor/bin/phpunit and look at the green bar:), (*5)

Usage

Firstly, create the dispatcher event:, (*6)

<?php

$dispatcher = new Eveniment\EventDispatcher();

Attach a simple subscriber to an event and after raise the event:, (*7)

<?php

$dispatcher->on('event.name', function($name) {
    echo $name;
});
$dispatcher->dispatch('event.name', ['Jon']);

You can set the subscriber priority also. However, the default priority is 1000:, (*8)

<?php

// This will be the last one called because the lower priority
$dispatcher->on('event.name', ['vendor\library\Class', 'onEventRaise'], 5);
// This subscriber will be the first one called because it has priority set to 1000
$dispatcher->on('event.name', function() {});

The Versions

09/06 2016

dev-master

9999999-dev

Eveniment is a simple event dispatching PHP library

  Sources   Download

The Requires

  • php >=5.4.0

 

The Development Requires

by Iosif Chiriluta

23/03 2016

1.0.0

1.0.0.0

Eveniment is a simple event dispatching PHP library

  Sources   Download

The Requires

  • php >=5.4.0

 

by Iosif Chiriluta