lithium\g11n\Locale::compose()

public static method

Composes a locale from locale tags. This is the pendant to Locale::decompose().

Parameters

  • array $tags

    An array as obtained from Locale::decompose().

Returns

string

A 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);
		}
	}