Home >Backend Development >PHP Tutorial >Yii2 basic Login 示例的代码疑问

Yii2 basic Login 示例的代码疑问

WBOY
WBOYOriginal
2016-06-06 20:35:321064browse

hi 大家好,我使用Yii2 basic,对于login示例,
请问:在 \yii2\basic\models\User.php 中,有如下:

public function validatePassword($password)
{
return $this->password === $password;
}

我知道$password是从loginform中来的,那,
问一下:
$this->password 这个是在什么时候填入的呢?

搞了半天搞不清。thx

回复内容:

hi 大家好,我使用Yii2 basic,对于login示例,
请问:在 \yii2\basic\models\User.php 中,有如下:

public function validatePassword($password)
{
return $this->password === $password;
}

我知道$password是从loginform中来的,那,
问一下:
$this->password 这个是在什么时候填入的呢?

搞了半天搞不清。thx

the answer refers to:
http://www.yiichina.com/tutorial/332

thx all。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn