frontend\modules\user\controllers\DefaultController::actionShow PHP Method

actionShow() public method

Shows user's profile.
public actionShow ( string $username = '' ) : Response
$username string
return yii\web\Response
    public function actionShow($username = '')
    {
        $user = $this->user($username);
        // 个人主页浏览次数
        $currentUserId = \Yii::$app->getUser()->getId();
        if (null != $currentUserId && $user->id != $currentUserId) {
            UserInfo::updateAllCounters(['view_count' => 1], ['user_id' => $user->id]);
        }
        return $this->render('show', ['user' => $user, 'dataProvider' => $this->comment($user->id)]);
    }