PHP Classes
elePHPant
Icontem

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

Recommend this page to a friend!

  Author Author  
Name: carlos carvalho <contact>
Classes: 5 packages by
Country: Brazil Brazil
Innovation award
Innovation award
Nominee: 1x


  Detailed description   Download Download .zip .tar.gz  
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.

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');

  Classes of carlos carvalho  >  Observable PHP Event Listener and Emitter  >  Download Download .zip .tar.gz  >  Support forum Support forum  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  

 

Name: Observable PHP Event Listener and Emitter
Base name: php-event
Description: Listen and emit events handled by callbacks
Version: -
PHP version: 5
License: GNU General Public License (GPL)
 
  Groups   Applications   Files Files  

  Groups  
Group folder image PHP 5 Classes using PHP 5 specific features View top rated classes
Group folder image Language Constructs to assist in the language control View top rated classes


  Applications that use this package  
No pages of applications that use this class were specified.

Add link image If you know an application of this package, send a message to the author to add a link here.

  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

Download Download all files: php-event.tar.gz php-event.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.