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.

54 lines
712 B
PHP

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?php
namespace app\admin\validate;
use think\Validate;
class Article extends Validate
{
protected $rule=[
'title'=>'unique:article|require',
'cateid'=>'require',
'content'=>'require',
];
protected $message=[
'title.require'=>'文章标题不得为空!',
'title.unique'=>'文章标题不得重复!',
// 'title.max'=>'文章标题长度大的大于25个字符',
'cateid.require'=>'文章所属栏目不得为空!',
'content.require'=>'文章内容不得为空!',
];
protected $scene=[
'add'=>['title','cateid','content'],
'edit'=>['title','cateid'],
];
}