From Joomla! Documentation

Revision as of 13:47, 23 November 2008 by Chris Davenport (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Returns a reference to the global configuration object, only creating it if it doesn't already exist. The object returned will be of type JRegistry.


object JRegistry getConfig( $file, $type )


Argument Data type Description Default
$file string Path to the configuration file. If null then path-to-joomla/libraries/joomla/config.php is assumed. null
$type string Type of configuration file. 'PHP'


This method is used to get access to the global configuration variables. In this example, the site name is retrieved.

$config =& JFactory::getConfig();
echo 'Site name is ' . $config->getValue( 'config.sitename' );

See also