File: test.php

Recommend this page to a friend!
  Classes of Kiril Savchev  >  PHP Event Aggregator  >  test.php  >  Download  
File: test.php
Role: Example script
Content type: text/plain
Description: Test examples
Class: PHP Event Aggregator
Manager and listener of registered events
Author: By
Last change:
Date: 5 years ago
Size: 821 bytes


Class file image Download

require_once 'EventAggregator.php';

 * Use this class to attach methods to events
class TestClass {
    static function
test() { var_dump(__CLASS__); }
    static function
test2($a,$b,$c='a') {

// Instantiate the event aggregator:
$Event = EventAggregator::getInstance();

// Attach some callbacks to custom event 'testEvent':

// Call the event:

// These commented lines do the same as the above - fires the event 'testEvent' with params __FILE__, __LINE__ and true
// $Event->trigger('testEvent',array(__FILE__,__LINE__,true));
// $Event->fire('testEvent',__FILE__,__LINE__,true);


For more information send a message to info at phpclasses dot org.