PHP Classes

File: readme.md

Recommend this page to a friend!
  Classes of carlos carvalho   Observable PHP Event Listener and Emitter   readme.md   Download  
File: readme.md
Role: Documentation
Content type: text/markdown
Description: Example script
Class: Observable PHP Event Listener and Emitter
Listen and emit events handled by callbacks
Author: By
Last change:
Date: 4 years ago
Size: 1,165 bytes
 

Contents

Class file image Download

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