Joomla! Programmierung/Framework/JFactory/getConfig
Aus Joomla! Dokumentation
JFactory/getConfig Liefert eine Referenz zu dem globalen JRegistry Objekt. Wird nur neu erstellt, wenn es noch nicht existiert.
Inhaltsverzeichnis |
Syntax
static getConfig( [$file], [$type] )
- @return object JRegistry
- @since
Beispiele
Wert aus globaler Konfiguration laden
Es ist Prinzipiell eleganter mittels getApplication und getCfg werte aus der Globalen Konfiguration zu laden, aber trotzdem hier mal ein Beispiel, wie man mittels getConfig an die Werte kommt.
$config = JFactory::getConfig(); echo 'Der Seitenname lautet ' . $config->getValue( 'config.sitename' );
Siehe auch
- JFactory->getConfig() auf api.joomla.org
- JRegistry
Quellcode
JFactory -> getConfig in Joomla! 1.5.14
function &getConfig($file = null, $type = 'PHP') { { if ($file === null) { } $instance = JFactory::_createConfig($file, $type); } return $instance; }
