PHP Classes
elePHPant
Icontem

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    
Last Updated Ratings Unique User Downloads Download Rankings
2020-02-29 (1 month ago) RSS 2.0 feedNot yet rated by the usersTotal: 55 This week: 3All time: 9,689 This week: 155Up
Version License PHP version Categories
php-event 1.0GNU General Publi...5PHP 5, Language
Description Author

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.

  Performance   Level  
Name: carlos carvalho <contact>
Classes: 5 packages by
Country: Brazil Brazil
Age: 37
All time rank: 3272251 in Brazil Brazil
Week rank: 158 Up4 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:55
This week:3
All time:9,689
This week:155Up