1. 程式人生 > >thinkphp5.0驗證

thinkphp5.0驗證

用戶名 think con 郵箱 username message validate valid thinkphp

<?php
namespace app\index\validate;
use think\Validate;
class Login extends Validate
{
protected $rule = [
‘username‘=>‘require|unique:login‘,
‘password‘=>‘require‘,
‘email‘=>‘require|email‘,
‘con‘=>‘require‘,

];
protected $message = [
‘username.require‘=>‘請填寫用戶名稱‘,
‘username.unique‘=>‘用戶名稱不能重復‘,
‘password.require‘=>‘請輸入用戶密碼‘,

‘email.require‘=>‘請填寫用戶郵箱‘,
‘con.require‘=>‘請填寫內容‘,
];
}

thinkphp5.0驗證