public function actionView($username) { $model = User::getViewProfile($username); if ($model === null) { throw new \yii\web\HttpException(404, 'User not be found.'); } return $this->render('view', ['model' => $model]); }