PHP Class common\models\LoginForm

Inheritance: extends yii\base\Model
Show file Open project: yiisoft/yii2-app-advanced Class Usage Examples

Public Properties

Property Type Description
$password
$rememberMe
$username

Public Methods

Method Description
login ( ) : boolean Logs in a user using the provided username and password.
rules ( )
validatePassword ( string $attribute, array $params ) Validates the password.

Protected Methods

Method Description
getUser ( ) : User | null Finds user by [[username]]

Method Details

getUser() protected method

Finds user by [[username]]
protected getUser ( ) : User | null
return User | null

login() public method

Logs in a user using the provided username 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

$password public property

public $password

$rememberMe public property

public $rememberMe

$username public property

public $username