这家伙有点懒,还没写个性签名!
中文名的文件。。就不能正常了。。
config > components : 'user' => [ 'identityClass' => 'common\models\User', 'enableAutoLogin' => true, ],
config > components :
'user' => [ 'identityClass' => 'common\models\User', 'enableAutoLogin' => true, ],
嗯。看到yii/base/Application 构造函数中 找到将其赋值的语句了。
需要有个表实现身份认证接口:implements IdentityInterface 然后这个模型对应什么表就是你自个定的了
@qiliux 能注册的。就是读取名字Yii::$app->user->indentity->username时,他找的是user表。
Yii::$app->user->indentity->username
我的users模型实现了这个接口的5个方法 。我也声明了tableName了。