How do you add, or get, variables using Yii::$app->user->something
?
I don't want to get them through identity
. I want to make specific ones accessible through user
.
For example, I want to get the current logged in user's username and name:
\Yii::$app->user->username
or
\Yii::$app->user->name