PHP Class Cml\Lang

Exibir arquivo Open project: linhecheng/cmlphp Class Usage Examples

Protected Properties

Property Type Description
$_content array 存放了所有语言信息
$lang array 存放了所有语言信息

Public Methods

Method Description
get ( string $key = null, string $default = '' ) : string 获取语言 不区分大小写 获取值的时候可以动态传参转出语言值 如:\Cml\Lang::get('_CML_DEBUG_ADD_CLASS_TIP_', '\Cml\Base') 取出_CML_DEBUG_ADD_CLASS_TIP_语言变量且将\Cml\base替换语言中的%s
set ( string | array $key, mixed $value = null ) : null 设置配置【语言】 支持批量设置 /a.b.c方式设置

Method Details

get() public static method

获取语言 不区分大小写 获取值的时候可以动态传参转出语言值 如:\Cml\Lang::get('_CML_DEBUG_ADD_CLASS_TIP_', '\Cml\Base') 取出_CML_DEBUG_ADD_CLASS_TIP_语言变量且将\Cml\base替换语言中的%s
public static get ( string $key = null, string $default = '' ) : string
$key string 支持.获取多维数组
$default string 不存在的时候默认值
return string

set() public static method

设置配置【语言】 支持批量设置 /a.b.c方式设置
public static set ( string | array $key, mixed $value = null ) : null
$key string | array 要设置的key,为数组时是批量设置
$value mixed 要设置的值
return null

Property Details

$_content protected_oe static_oe property

存放了所有语言信息
protected static array $_content
return array

$lang protected_oe static_oe property

存放了所有语言信息
protected static array $lang
return array