[TOC]

bearMark使用

->setValidate($rule,$msg)

rele

  [
        'name|姓名'  => 'require|max:25',
        'age'   => 'number|between:1,120',
        'email' => 'email',    
    ]

独立验证

任何时候,都可以使用Validate类进行独立的验证操作,例如:

use bear\sys\validate\Validate;
$data = [];
      Validate::rule([
        'name|姓名'  => 'require|max:25',
        'age'   => 'number|between:1,120',
        'email' => 'email',    
    ]);
    

      $result   = Validate::check($data);
      show(Validate::getError());