original_string: public function actionUpdate($id)
      {
          $model = $this->findModel($id);
          $model->scenario = 'update';
  
          if ($model->load(\Yii::$app->request->post()) && $model->save()) {
              if(\Yii::$app->request->get('returnUrl')){
                  $back = urldecode(\Yii::$app->request->get('returnUrl'));
                  return $this->redirect($back);
              }
  
              \Yii::$app->getSession()->setFlash('block.success', \Yii::t('block', 'Block has been updated'));
              return $this->refresh();
          }
  
          return $this->render('update', [
              'model' => $model
          ]);
      }
code: public function actionUpdate($id)
      {
          $model = $this->findModel($id);
          $model->scenario = 'update';
  
          if ($model->load(\Yii::$app->request->post()) && $model->save()) {
              if(\Yii::$app->request->get('returnUrl')){
                  $back = urldecode(\Yii::$app->request->get('returnUrl'));
                  return $this->redirect($back);
              }
  
              \Yii::$app->getSession()->setFlash('block.success', \Yii::t('block', 'Block has been updated'));
              return $this->refresh();
          }
  
          return $this->render('update', [
              'model' => $model
          ]);
      }
code_tokens: public function actionUpdate ( $ id ) { $ model = $ this -> findModel ( $ id ) ; $ model -> scenario = 'update' ; if ( $ model -> load ( \ Yii :: $ app -> request -> post ( ) ) && $ model -> save ( ) ) { if ( \ Yii :: $ app -> request -> get ( 'returnUrl' ) ) { $ back = urldecode ( \ Yii :: $ app -> request -> get ( 'returnUrl' ) ) ; return $ this -> redirect ( $ back ) ; } \ Yii :: $ app -> getSession ( ) -> setFlash ( 'block.success' , \ Yii :: t ( 'block' , 'Block has been updated' ) ) ; return $ this -> refresh ( ) ; } return $ this -> render ( 'update' , [ 'model' => $ model ] ) ; }
docstring: Updates an existing Block model.
  If update is successful, the browser will be redirected to the 'index' page.
  @param  integer $id
  @return mixed
docstring_tokens: Updates an existing Block model . If update is successful the browser will be redirected to the index page .