value by default using textInput

hi everyone, i want to show by default the username of the logged in my app, i did this

$userlog = \app\models\User::findOne('id'==Yii::$app->user->getId());



<?= $form->field($model, 'plan_reg_por')->textInput(['maxlength' => 255,'style'=>'width:250px;','value'=>$userlog ->username]) ?>

but when i load mi page i’ve got this error:

PHP Notice – yii\base\ErrorException

Trying to get property of non-object

Any idea?

solved, i used this

$userlog = app\models\UserIdentity::findIdentity(Yii::$app->user->getId())->username;

and everything works perfectly