- Openclerk\Events
class Openclerk \ Events
JQuery-like event passing for PHP.
Events::on('reload', function($event) { print_r($event); }); Events::trigger('reload', array('args'));
Method Summary
Name | Description |
---|---|
on($event_name, $callback) | Register an event handler. |
trigger($event_name, $event = null) | Trigger an event. |
unbind($handler) | Removes an event handler. |
static function on($event_name, $callback)
Register an event handler.
- Returns:
data that can be used to unbind the event handler in #unbind().
static function trigger($event_name, $event = null)
Trigger an event.
- Defaults:
event
=null
static function unbind($handler)
Removes an event handler.
- Parameters:
$handler
- event handler information returned in #on().