yii2 - get logged user

yii2
voted: 1
vote
yii2 php logged user get

Gettin logged user in yii2 framework

<?php
//whole logged user
$user = \Yii::$app->user->identity;

//id of logged user
$userId = \Yii::$app->user->identity->id
?>
working url: not entered
version: 2 and maybe others
Leave a Comment:
Characters left:
No comments yet.