original_string: public function actionProfile()
      {
          $model = UserProfile::findOne(['user_id' => Yii::$app->user->identity->getId()]);
          if (Yii::$app->request->isAjax && $model->load(Yii::$app->request->post())) {
              Yii::$app->response->format = Response::FORMAT_JSON;
              return ActiveForm::validate($model);
          }
          if ($model->load(Yii::$app->request->post()) && $model->save()) {
              Yii::$app->getSession()->setFlash('success', Yii::t('yuncms', 'Your profile has been updated'));
              return $this->refresh();
          }
          return $this->render('profile', [
              'model' => $model,
          ]);
      }
code: public function actionProfile()
      {
          $model = UserProfile::findOne(['user_id' => Yii::$app->user->identity->getId()]);
          if (Yii::$app->request->isAjax && $model->load(Yii::$app->request->post())) {
              Yii::$app->response->format = Response::FORMAT_JSON;
              return ActiveForm::validate($model);
          }
          if ($model->load(Yii::$app->request->post()) && $model->save()) {
              Yii::$app->getSession()->setFlash('success', Yii::t('yuncms', 'Your profile has been updated'));
              return $this->refresh();
          }
          return $this->render('profile', [
              'model' => $model,
          ]);
      }
code_tokens: public function actionProfile ( ) { $ model = UserProfile :: findOne ( [ 'user_id' => Yii :: $ app -> user -> identity -> getId ( ) ] ) ; if ( Yii :: $ app -> request -> isAjax && $ model -> load ( Yii :: $ app -> request -> post ( ) ) ) { Yii :: $ app -> response -> format = Response :: FORMAT_JSON ; return ActiveForm :: validate ( $ model ) ; } if ( $ model -> load ( Yii :: $ app -> request -> post ( ) ) && $ model -> save ( ) ) { Yii :: $ app -> getSession ( ) -> setFlash ( 'success' , Yii :: t ( 'yuncms' , 'Your profile has been updated' ) ) ; return $ this -> refresh ( ) ; } return $ this -> render ( 'profile' , [ 'model' => $ model , ] ) ; }
docstring: Shows profile settings form.
  @return array|string|Response
docstring_tokens: Shows profile settings form .