1
0
Files
helper/application/common/validate/Config.php
2020-08-06 14:58:51 +08:00

45 lines
1.4 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// +------------------------------------------------+
// |http://www.cjango.com |
// +------------------------------------------------+
// | 修复BUG不是一朝一夕的事情等我喝醉了再说吧 |
// +------------------------------------------------+
// | Author: 小陈叔叔 <Jason.Chen> |
// +------------------------------------------------+
namespace app\common\validate;
use think\Validate;
/**
* 配置验证器
*/
class Config extends Validate
{
/**
* 验证规则
* @var array
*/
protected $rule = [
'title' => 'require|min:3|max:32',
'name' => 'require|min:3|max:32|unique:config',
'sort' => 'number',
'value' => 'require',
];
/**
* 错误提示消息
* @var array
*/
protected $message = [
'title.require' => '配置名称必须填写',
'title.min' => '配置名称不应少于:rule个字符',
'title.max' => '配置名称不应大于:rule字符',
'name.require' => '配置标识必须填写',
'name.min' => '配置标识不应少于:rule个字符',
'name.max' => '配置标识不应大于:rule字符',
'name.unique' => '配置标识已经存在',
'sort.number' => '排序必须是数字',
'value.require' => '配置值必须填写',
];
}