Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Error after register by \Yii::$app->user->identity->username #173

Open
songwutk opened this issue May 30, 2015 · 1 comment
Open

Error after register by \Yii::$app->user->identity->username #173

songwutk opened this issue May 30, 2015 · 1 comment

Comments

@songwutk
Copy link

After I register user, error show.

" PHP Notice – yii\base\ErrorException
Trying to get property of non-object".

in /var/www/qiudao/modules/admin/views/layouts/main.php
\Yii::$app->user->identity->username

Cause of not complete login but call app variable.

Should I create new var that checkby isset() ?

$username=''; if (isset(\Yii::$app->user->identity->username) $username = \Yii::$app->user->identity->username;

and the others.

@schmunk42
Copy link
Member

Should I create new var that checkby isset() ?

$username=''; if (isset(\Yii::$app->user->identity->username) $username = \Yii::$app->user->identity->username;

Yes I think so.

and the others.

Which ones?

The admin module is meant to be customized, if needed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants