JLanguageHelper/createLanguageList
From Joomla! Documentation
< API16:JLanguageHelper
The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.
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 >