You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
456 B
PHTML

3 years ago
<?php
namespace app\admin\validate;
use think\Validate;
/**
* 钩子验证器
* @package app\admin\validate
* @author 蔡伟明 <314013107@qq.com>
*/
class Hook extends Validate
{
//定义验证规则
protected $rule = [
'name|钩子名称' => 'require|regex:^[a-zA-Z]\w{0,39}$|unique:admin_hook'
];
//定义验证提示
protected $message = [
'name.regex' => '钩子名称由字母和下划线组成',
];
}