PHP Classes

Observable PHP Event Listener and Emitter: Listen and emit events handled by callbacks

Recommend this page to a friend!
  Info   View files Example   View files View files (10)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 66 All time: 10,246 This week: 154Up
Version License PHP version Categories
php-event 1.0GNU General Publi...5PHP 5, Language
Description 

Author

Carlos Carvalho


Contributor

This package can be used to listen and emit events handled by callbacks.

It can register an event handler by name and associate a callback function to handle that event.

The package can also emit an event with a given name passing some parameters and make the previously registered event handlers be called.

Picture of carlos carvalho
  Performance   Level  
Name: carlos carvalho <contact>
Classes: 6 packages by
Country: Brazil Brazil
Age: 40
All time rank: 3239244 in Brazil Brazil
Week rank: 402 Up31 in Brazil Brazil Up
Innovation award
Innovation award
Nominee: 1x

Details

Events fire

Is simple observable events for php

Codacy Badge Latest Stable Version Total Downloads Latest Unstable Version License

Install

 composer require carlosocarvalho/event

usage

<?php

$emitter = \COC\Event\Emitter::getInstance();

$emitter->on('evm.createdUser', function($name, $lastname){
    print("hello {$lastname}, {$name} welcome!!");
});

$emitter->emit('evm.createdUser','Firstname','Lastname');
  Files folder image Files  
File Role Description
Files folder imagespec (1 file)
Files folder imagesrc (4 files)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file index.php Example Example script
Accessible without login Plain text file readme.md Doc. Example script
Accessible without login Plain text file _config.yml Data Auxiliary data

  Files folder image Files  /  spec  
File Role Description
  Plain text file Emitter.spec.php Class Class source

  Files folder image Files  /  src  
File Role Description
  Plain text file DoubleEventException.php Class Class source
  Plain text file Emitter.php Class Class source
  Plain text file Listener.php Class Class source
  Plain text file SubscribeContract.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:66
This week:0
All time:10,246
This week:154Up