您的位置:首页 > 编程语言 > PHP开发

[李景山php]每天laravel-20161006|Validator.php-6

2016-08-05 09:24 507 查看
/**
* Validate that an attribute is different from another attribute.
*
* @param  string  $attribute
* @param  mixed   $value
* @param  array   $parameters
* @return bool
*/
protected function validateDifferent($attribute, $value, $parameters)
{
$this->requireParameterCount(1, $parameters, 'different');// require Parameter Count

$other = Arr::get($this->data, $parameters[0]);//Arr::get(data,)

return isset($other) && $value !== $other;//return value
}// Validate that an attribute is different from another attribute

/**
* Validate that an attribute was "accepted".
*
* This validation rule implies the attribute is "required".
*
* @param  string  $attribute
* @param  mixed   $value
* @return bool
*/
protected function validateAccepted($attribute, $value)
{
$acceptable = ['yes', 'on', '1', 1, true, 'true'];

return $this->validateRequired($attribute, $value) && in_array($value, $acceptable, true);
}//Validate that an attribute was "accepted"
// change every thing it is ok!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  different function another