API16:JLanguageHelper/createLanguageList
From Joomla! Documentation
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.
Contents |
Description
Builds a list of the system languages which can be used in a select option
Description:JLanguageHelper/createLanguageList
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; }
[Edit See Also] SeeAlso:JLanguageHelper/createLanguageList
Examples
<CodeExamplesForm />
