| API | Package | Subpackage | Class | Method | Reference | Last reviewed | Doc status |
|---|---|---|---|---|---|---|---|
Home |
Joomla.Framework |
Application |
JApplication |
registerEvent |
registerEvent() |
Never | Work in Progress |
Registers a handler to a particular event group. This method is used to attach an event handler object or function to a particular event.
void registerEvent ( $event, $handler )
| $event | string | is a string containing the name of the event to which to register the handler. |
| $handler | string | is a string containing the name of the function that contains the handler, or the name of an object that extends the JObserver class (i.e. a JPlugin object). |
The ‘vote’ plugin calls this method as follows (this code is not called from within a function so the $mainframe object is in scope:
Example
$mainframe->registerEvent( 'onBeforeDisplayContent', 'pluginVote' );