Actions

API15

JDispatcher/getInstance

From Joomla! Documentation

< API15:JDispatcher
Revision as of 17:20, 22 March 2010 by Doxiki (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

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

[Edit Descripton]

Description:JDispatcher/getInstance

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;
}

[Edit See Also] SeeAlso:JDispatcher/getInstance

Examples

<CodeExamplesForm />