original_string: public function actionCreate()
      {
          $model = new Address(['scenario' => 'create']);        
          Yii::$app->response->format = Response::FORMAT_JSON;
          if ($model->load(Yii::$app->request->post())) {
              if ($model->validate()) {
                  if ($model->save(false)) {
                      return $this->tree($model);
                  } else {
                      Yii::$app->response->setStatusCode(500);
                      return \Yii::t('net_frenzel_address', 'FRONTEND_FLASH_FAIL_CREATE');
                  }
              } elseif (Yii::$app->request->isAjax) {
                  Yii::$app->response->setStatusCode(400);
                  return ActiveForm::validate($model);
              }
          }
      }
code: public function actionCreate()
      {
          $model = new Address(['scenario' => 'create']);        
          Yii::$app->response->format = Response::FORMAT_JSON;
          if ($model->load(Yii::$app->request->post())) {
              if ($model->validate()) {
                  if ($model->save(false)) {
                      return $this->tree($model);
                  } else {
                      Yii::$app->response->setStatusCode(500);
                      return \Yii::t('net_frenzel_address', 'FRONTEND_FLASH_FAIL_CREATE');
                  }
              } elseif (Yii::$app->request->isAjax) {
                  Yii::$app->response->setStatusCode(400);
                  return ActiveForm::validate($model);
              }
          }
      }
code_tokens: public function actionCreate ( ) { $ model = new Address ( [ 'scenario' => 'create' ] ) ; Yii :: $ app -> response -> format = Response :: FORMAT_JSON ; if ( $ model -> load ( Yii :: $ app -> request -> post ( ) ) ) { if ( $ model -> validate ( ) ) { if ( $ model -> save ( false ) ) { return $ this -> tree ( $ model ) ; } else { Yii :: $ app -> response -> setStatusCode ( 500 ) ; return \ Yii :: t ( 'net_frenzel_address' , 'FRONTEND_FLASH_FAIL_CREATE' ) ; } } elseif ( Yii :: $ app -> request -> isAjax ) { Yii :: $ app -> response -> setStatusCode ( 400 ) ; return ActiveForm :: validate ( $ model ) ; } } }
docstring: Create Address.
docstring_tokens: Create Address .