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

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

@songwutk

Description

@songwutk

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions