API16

API16:JDispatcher/getInstance

From Joomla! Documentation

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

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