lithium\g11n\Locale::__callStatic()

public static method

Magic method enabling language, script, territory and variant methods to parse and retrieve individual tags from a locale.

Locale::language('en_US'); // returns 'en'
Locale::territory('en_US'); // returns 'US'

Parameters

  • string $method
  • array $params

Returns

mixed

Source

	public static function __callStatic($method, $params = []) {
		$tags = static::decompose(current($params));

		if (!isset(static::$_tags[$method])) {
			throw new BadMethodCallException("Invalid locale tag `{$method}`.");
		}
		return isset($tags[$method]) ? $tags[$method] : null;
	}