lithium\g11n\Locale::compose()
Composes a locale from locale tags. This is the pendant to Locale::decompose()
.
Parameters
-
array
$tags
An array as obtained from
Locale::decompose()
.
Returns
stringA locale with tags separated by underscores or null
if none of the passed tags could be used to compose a locale.
Source
public static function compose($tags) {
$result = [];
foreach (static::$_tags as $name => $tag) {
if (isset($tags[$name])) {
$result[] = $tags[$name];
}
}
if ($result) {
return implode('_', $result);
}
}