|
|
@ -1,23 +1,43 @@ |
|
|
|
<?php |
|
|
|
namespace Wiggins\MyProject\Models; |
|
|
|
namespace Wiggins\MyProject; |
|
|
|
|
|
|
|
use yii\base\Model; |
|
|
|
|
|
|
|
/** |
|
|
|
* UserInput类是用于用户登录或注册场景中输入数据 |
|
|
|
* @author kuangweijian <867034892@qq.com> |
|
|
|
* @since 1.0.0 |
|
|
|
*/ |
|
|
|
class UserInput extends Model |
|
|
|
{ |
|
|
|
/** |
|
|
|
* @var string 姓名 |
|
|
|
*/ |
|
|
|
public $name; |
|
|
|
|
|
|
|
/** |
|
|
|
* @var string 邮件 |
|
|
|
*/ |
|
|
|
public $email; |
|
|
|
|
|
|
|
public $name; //@var string 姓名
|
|
|
|
public $email; //@var string 邮箱
|
|
|
|
public $password; //@var string 密码
|
|
|
|
public $pwdConfirm; //@var string 确认密码
|
|
|
|
/** |
|
|
|
* @var string 密码 |
|
|
|
*/ |
|
|
|
public $password; |
|
|
|
|
|
|
|
/** |
|
|
|
* @scenario 登陆场景 |
|
|
|
*/ |
|
|
|
* @var string 确认密码 |
|
|
|
*/ |
|
|
|
public $pwdConfirm; |
|
|
|
|
|
|
|
/** |
|
|
|
* 登录场景 |
|
|
|
*/ |
|
|
|
const SCENARIO_LOGIN = 'login'; |
|
|
|
|
|
|
|
/** |
|
|
|
* @scenario 注册场景 |
|
|
|
*/ |
|
|
|
* 注册场景 |
|
|
|
*/ |
|
|
|
const SCENARIO_REGISTER = 'register'; |
|
|
|
|
|
|
|
|
|
|
@ -44,8 +64,6 @@ |
|
|
|
return[ |
|
|
|
//用户名长度
|
|
|
|
['name','string','length'=>[3,20],'message'=>'用户名长度为3至20个字符'], |
|
|
|
//用户名唯一性
|
|
|
|
//['name','unique'],
|
|
|
|
//邮件格式
|
|
|
|
['email','email'], |
|
|
|
//密码格式
|
|
|
|