PHP Class frontend\models\LoginForm

Inheritance: extends yii\base\Model
Show file Open project: daixianceng/xiaoego.com Class Usage Examples

Public Properties

Property Type Description
$mobile
$password
$rememberMe

Public Methods

Method Description
attributeLabels ( )
getUser ( ) : User | null Finds user by [[mobile]]
login ( ) : boolean Logs in a user using the provided mobile and password.
rules ( )
validatePassword ( string $attribute, array $params ) Validates the password.

Method Details

attributeLabels() public method

public attributeLabels ( )

getUser() public method

Finds user by [[mobile]]
public getUser ( ) : User | null
return common\models\User | null

login() public method

Logs in a user using the provided mobile and password.
public login ( ) : boolean
return boolean whether the user is logged in successfully

rules() public method

public rules ( )

validatePassword() public method

This method serves as the inline validation for password.
public validatePassword ( string $attribute, array $params )
$attribute string the attribute currently being validated
$params array the additional name-value pairs given in the rule

Property Details

$mobile public property

public $mobile

$password public property

public $password

$rememberMe public property

public $rememberMe