[李景山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!
相关文章推荐
- Android Native 绘图方法
- javascript 面向对象编程 function是方法(函数)
- javascript 面向对象编程 function也是类
- ASP.NET MVC @Helper辅助方法和@functons自定义函数的使用方法
- IIS下PHP连接数据库提示mysql undefined function mysql_connect()
- 浅谈Javascript中Object与Function对象
- JavaScript通过function定义对象并给对象添加toString()方法实例分析
- IE 当eval遇上function的处理
- JavaScript中Object和Function的关系小结
- Javascript 使用function定义构造函数
- 关于function类中定义变量this的简单说明
- javascript Object与Function使用
- JavaScript中的Function函数
- 使用Function.apply()的参数数组化来提高 JavaScript程序性能的技巧
- javascript下function声明一些小结
- 常用的javascript function代码
- 简单谈谈jQuery(function(){})与(function(){})(jQuery)
- 浅析jQuery(function(){})与(function(){})(jQuery)之间的区别
- JavaScript的jQuery库中function的存在和参数问题
- js function使用心得