PHP Class Overtrue\Validation\Translator

Inheritance: implements Overtrue\Validation\TranslatorInterface
Show file Open project: overtrue/validation

Protected Properties

Property Type Description
$defaultMessages array 默认消息.
$messages

Public Methods

Method Description
__construct ( array $messages = [] ) 设置验证消息列表.
trans ( string $key ) : string 翻译.

Protected Methods

Method Description
arrayGet ( array $array, string $key, mixed $default = null ) : mixed 使用点字符串获取.

Method Details

__construct() public method

设置验证消息列表.
public __construct ( array $messages = [] )
$messages array

arrayGet() protected method

使用点字符串获取.
protected arrayGet ( array $array, string $key, mixed $default = null ) : mixed
$array array
$key string
$default mixed
return mixed

trans() public method

翻译.
public trans ( string $key ) : string
$key string 点拼接的key
return string

Property Details

$defaultMessages protected property

默认消息.
protected array $defaultMessages
return array

$messages protected property

protected $messages