API16:JLanguageHelper/createLanguageList
From Joomla! Documentation
Description
Builds a list of the system languages which can be used in a select option
<! removed transcluded page call, red link never existed >
Syntax
static createLanguageList($actualLanguage, $basePath=JPATH_BASE, $caching=false)
| Parameter Name | Default Value | Description |
|---|---|---|
| $actualLanguage | Client key for the area | |
| $basePath | JPATH_BASE | Base path to use |
| $caching | false | An array of arrays (text, value, selected) |
Defined in
libraries/joomla/language/helper.php
Importing
jimport( 'joomla.language.helper' );
Source Body
public static function createLanguageList($actualLanguage, $basePath = JPATH_BASE, $caching = false)
{
$list = array ();
// cache activation
$langs = JLanguage::getKnownLanguages($basePath);
foreach ($langs as $lang => $metadata)
{
$option = array ();
$option['text'] = $metadata['name'];
$option['value'] = $lang;
if ($lang == $actualLanguage) {
$option['selected'] = 'selected="selected"';
}
$list[] = $option;
}
return $list;
}
<! removed transcluded page call, red link never existed >
Examples
Code Examples