S
S
Sergey Beloventsev2016-11-17 10:51:14
Yii
Sergey Beloventsev, 2016-11-17 10:51:14

How to get login user model?

Actually, I need this in order to use links with other models, for example, there is a model Adduserfieldthat is connected to the model like thisUser

public function getAdduserfeild(){
        return $this->hasOne(Adduserfeild::className(),['id_user'=>'id']);
    }

how can i get the fields from the Adduserfieldlogin user model?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Fedorov, 2016-11-17
@Sergalas

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 question

Ask a Question

731 491 924 answers to any question