Event handlers and Hooks
Lepton contains a very powerful event system. With this event system, you can invoke and react to events, passing variables and objects around between classes. The strength of this functionality comes with the fact that several handlers can exist for each event. For example, a content management system can f.ex. have its plugins register events to add navigation elements and to output additional stylesheets and script tags in the rendered page's <head> tag.
Registering an event handler
class MySiteClass {
static function onSomeEvent($tag=null,$str=null) {
echo $str;
}
}
Events::observe('mysite:some.event', new Callback(MySiteClass,'onSomeEvent'));
Invoking an event
Events::invoke('mysite:some.event', 'hello world');
Built-in Events
Lepton comes with a bunch of built-in events that can be hooked. For a full list, see Reference/Handlers/Builtin
