API15

API15:JDispatcher/getInstance

From Joomla! Documentation

Revision as of 00:29, 25 March 2017 by JoomlaWikiBot (talk | contribs) (preparing for archive only)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

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

[<! removed edit link to red link >]

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

Syntax

& getInstance()


Returns

The EventDispatcher object. 

Defined in

libraries/joomla/event/dispatcher.php

Importing

jimport( 'joomla.event.dispatcher' );

Source Body

function & getInstance()
{
        static $instance;

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

        return $instance;
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

Code Examples