API15:JToolBar/getInstance
From Joomla! Documentation
Description
Returns a reference to a global JToolBar 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($name= 'toolbar')
| Parameter Name | Default Value | Description |
|---|---|---|
| $name | 'toolbar' | $name The name of the toolbar. |
Returns
The object.
Defined in
libraries/joomla/html/toolbar.php
Importing
jimport( 'joomla.html.toolbar' );
Source Body
function & getInstance($name = 'toolbar')
{
static $instances;
if (!isset ($instances)) {
$instances = array ();
}
if (empty ($instances[$name])) {
$instances[$name] = new JToolBar($name);
}
return $instances[$name];
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
Code Examples