2017 © Pedro Peláez
 

library event

Event system

image

eleven-x/event

Event system

  • Thursday, December 29, 2016
  • by eleven-x
  • Repository
  • 0 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Eleven-x Event

Simple php event system, (*1)

Install

composer require eleven-x/event, (*2)

API

addListener($eventName, \Closure $listener, $priority = 0, $once = false)

Adds the listener function to the end of the listeners array for the event named $eventName, (*3)

  • $eventName event name
  • $listener listener function
  • $priority The higher the value, the higher the priority
  • $once whether it is a one-time

once($eventName, \Closure $listener)

Adds a one time listener function for the event named $eventName. The next time $eventName is triggered, this listener is removed and then invoked., (*4)

  • $eventName event name
  • $listener listener function

removeListener($eventName)

Removes the specified listener from the listener array for the event named $eventName., (*5)

  • $eventName event name

hasListeners($eventName)

Whether there is a listener, (*6)

  • $eventName event name

dispatch($eventName, Event $event = null)

Calls each of the listeners registered for the event named $eventName, (*7)

  • $eventName event name
  • $event Event object

License

MIT, (*8)

The Versions

29/12 2016

dev-master

9999999-dev

Event system

  Sources   Download

MIT

by Avatar eleven-x

29/12 2016

v0.1.0

0.1.0.0

Event system

  Sources   Download

MIT

by Avatar eleven-x