[李景山php]每天laravel-20161006|Validator.php-6
2016-08-05 09:23
477 查看
/** * 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!
相关文章推荐
- Windows下的PHP扩展
- 源码编译安装php5.6
- php程序开销比较
- php中实现记住密码下次自动登录的例子
- 连续输入密码错误3次,第二天才能登录
- 定时任务的配置 及原理
- PHPCMS首页调用TAG关键字列表
- 初始FTP
- php环境搭建
- PHP实现简单的增删改查
- yii框架的验证规则
- php-fpm进程数优化
- No new migrations found. Your system is up-to-date.
- php中通过post和get传递数组的方法
- mac10.11配置xdebug+vscode
- php三天基础笔记(6)变量的传值赋值和引用赋值 (7)变量销毁 (动态变量名)
- PHP面向对象之解说(封装,继承,多态,引用,【const,define】)
- PHP面向对象----(interface区别abstract)
- PHP面向对象----(私有属性的访问方法)
- ubuntu PPTPD 配置