Support Joomla!

references:joomla.framework:application:japplication-registerevent

Table of Contents

registerEvent

API Package Subpackage Class Method Reference Last reviewed Doc status
API Home Package Joomla.Framework Subpackage Application Class JApplication Method registerEvent Reference 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.

Syntax

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).

Examples

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' );

 
references/joomla.framework/application/japplication-registerevent.txt (659 views) · Last modified: 2007/08/15 14:49