Thursday, 5 February 2015

yii2 get logged in user details

 
//To get whole logged user data
$user = \Yii::$app->user->identity;

//To get id of f logged user
$userId = \Yii::$app->user->identity->id