验证场景
针对不同的方法,来设立不同的场景,以便实现不同方法仅需验证部分字段
定义
protected $scene=[
'edit' => ['name','age'],
'insert' => ['name','age','email']
];
调用
class check extends Controller
{
//批量验证
protected $batchValidate=true;
//抛出异常
//protected $failException = true;
public function index()
{
$result = $this