Answer the question
In order to leave comments, you need to log in
How to get login user model?
Actually, I need this in order to use links with other models, for example, there is a model Adduserfield
that is connected to the model like thisUser
public function getAdduserfeild(){
return $this->hasOne(Adduserfeild::className(),['id_user'=>'id']);
}
Adduserfield
login user model?
Answer the question
In order to leave comments, you need to log in
if you are using the standard Yii implementation, the logged in user model can be obtained via Yii::$app->user->identity
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question