API16

API16:JDispatcher/getInstance

From Joomla! Documentation

Description

Returns the global Event Dispatcher object, only creating it if it doesn't already exist.


<! removed transcluded page call, red link never existed >

Syntax

static getInstance()


Returns

The EventDispatcher object. 

Defined in

libraries/joomla/event/dispatcher.php

Importing

jimport( 'joomla.event.dispatcher' );

Source Body

public static function getInstance()
{
        static $instance;

        if (!is_object($instance)) {
                $instance = new JDispatcher();
        }

        return $instance;
}


<! removed transcluded page call, red link never existed >

Examples

Code Examples