Ratings | | Unique User Downloads | | Download Rankings |
Not enough user ratings | | Total: 69 | | All time: 10,310 This week: 96 |
|
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. | |
 |
|
Innovation award
 Nominee: 2x |
|
Example
<?php
require_once __DIR__ . '/vendor/autoload.php';
$emitter = \COC\Event\Emitter::getInstance();
$emitter->on('evm.createdUser', function($name, $lastname){
print("hello {$lastname}, {$name} welcome!!");
});
$emitter->emit('evm.createdUser','Carlos','Carvalho');
|
Details
Events fire
Is simple observable events for php
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');
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.