//开启验证器
protected $modelValidate = true; //是否开启validate 验证默认是fasle 关闭状态
protected $modelSceneeVaildate = true; //是否开启模型场景验证默认是false 关闭状态 (模型场景)
在验证控制器文件下修改对应的文件夹:
/**
* 验证规则
*/
protected $rule = [
"ceshiint" =>"require",
"float" =>"require"
];
/**
* 提示消息
*/
protected $message = [
"ceshiint.require"=>"ceshiint为必填项",
"float.require" =>"float为必填项"
];
/**
* 验证场景
*/
protected $scene = [
'add' => ["ceshiint","float"],
'edit' => ["ceshiint"],
];