JFactory/getConfig
From Joomla! Documentation
< JFactory
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.
Syntax
object JRegistry getConfig( $file, $type )
where:
| 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' |
Example
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' );