Public Member Functions | |
__construct () | |
exist ($name) | |
attach ($name, $method) | |
detach ($name) | |
trigger ($name, $data) | |
Private Attributes | |
$events | |
hash of event handlers |
__construct | ( | ) |
constructor
attach | ( | $ | name, | |
$ | method | |||
) |
Attach custom code to event.
Only on event handler can be attached in the same time. If new event handler attached - old will be detached.
name | name of event, case non-sensitive | |
method | function which will be attached. You can use array(class, method) if you want to attach the method of the class. |
detach | ( | $ | name | ) |
Detach code from event
name | name of event, case non-sensitive |
exist | ( | $ | name | ) |
Method check if event with such name already exists.
name | name of event, case non-sensitive |
trigger | ( | $ | name, | |
$ | data | |||
) |
Trigger event.
name | name of event, case non-sensitive | |
data | value which will be provided as argument for event function, you can provide multiple data arguments, method accepts variable number of parameters |
$events [private] |
hash of event handlers