Beispiel #1
0
 public function actionProfile()
 {
     if (YII_DEBUG) {
         error_log("[Site::Profile]");
     }
     if (YII_DEBUG) {
         error_log("[Site::Profile] POST vars : " . json_encode(Yii::$app->request->post()));
     }
     if (\Yii::$app->user->isGuest && !Yii::$app->request->get('id')) {
         return $this->goHome();
     }
     $model = new ProfileForm();
     if (Yii::$app->request->isPost && Yii::$app->request->post('ProfileForm')) {
         $model->saveProfile();
     }
     if (!$model->isEditable) {
         $this->layout = 'unsigned';
     }
     return $this->render('profile', ['model' => $model]);
 }