BabyValidate.php
855 字节
<?php
/**
* Created by PhpStorm.
* User: 29925
* Date: 2018/9/10
* Time: 9:47
*/
namespace app\admin\validate;
use think\Validate;
class BabyValidate extends Validate
{
protected $rule = [
'age' => 'require',
'title' => 'require',
'video_url' => 'require|url',
'content' => 'require',
];
protected $message = [
'age.require' => '年龄段不能为空',
'title|require' => '详情内容不能为空',
'video_url.require' => '视频外链不能为空',
'video_url.url' => '视频外链格式错误',
'content|require' => '详情内容不能为空',
];
// protected $scene = [
// 'add' => ['age', 'video_url'],
// 'edit' => ['age', 'video_url'],
// ];
}