Validator.php-6

释放双眼,带上耳机,听听看~!

 /**

    * 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!

【转自慕课】https://www.imooc.com

PHP

php读取输出其他文件方法

2022-3-3 18:08:56

PHP

php、apache、nginx解决跨域问题

2022-3-3 18:09:42

搜索