original_string: public function actionEdit($id)
      {
          $model = $this->findModel($id);
          $form  = new LanguageForm($model);
          if (Yii::$app->request->isAjax && $form->load(Yii::$app->request->post())){
              if (!$errors = ActiveForm::validate($form)) {
                  try {
                      $this->service->edit($form->id, $form);
                      $this->output['status'] = 1;
                  } catch (YiiException $e) {
                      $errors = ErrorHelper::checkModel($e->data, $form);
                  }
              }
              return $this->output['errors'] = $errors;
          }
          return $this->render('edit', ['model' => $form]);
      }
code: public function actionEdit($id)
      {
          $model = $this->findModel($id);
          $form  = new LanguageForm($model);
          if (Yii::$app->request->isAjax && $form->load(Yii::$app->request->post())){
              if (!$errors = ActiveForm::validate($form)) {
                  try {
                      $this->service->edit($form->id, $form);
                      $this->output['status'] = 1;
                  } catch (YiiException $e) {
                      $errors = ErrorHelper::checkModel($e->data, $form);
                  }
              }
              return $this->output['errors'] = $errors;
          }
          return $this->render('edit', ['model' => $form]);
      }
code_tokens: public function actionEdit ( $ id ) { $ model = $ this -> findModel ( $ id ) ; $ form = new LanguageForm ( $ model ) ; if ( Yii :: $ app -> request -> isAjax && $ form -> load ( Yii :: $ app -> request -> post ( ) ) ) { if ( ! $ errors = ActiveForm :: validate ( $ form ) ) { try { $ this -> service -> edit ( $ form -> id , $ form ) ; $ this -> output [ 'status' ] = 1 ; } catch ( YiiException $ e ) { $ errors = ErrorHelper :: checkModel ( $ e -> data , $ form ) ; } } return $ this -> output [ 'errors' ] = $ errors ; } return $ this -> render ( 'edit' , [ 'model' => $ form ] ) ; }
docstring: Edites an existing Language model.
  If update is successful, the browser will be redirected to the 'view' page.
  @param integer $id
  @return mixed
docstring_tokens: Edites an existing Language model . If update is successful the browser will be redirected to the view page .