original_string: public function actionEditForum($cid = null, $id = null)
      {
          $model = Forum::find()->where(['id' => $id, 'category_id' => $cid])->limit(1)->one();
          if (empty($model)) {
              $this->error(Yii::t('podium/flash', 'Sorry! We can not find Forum with this ID.'));
              return $this->redirect(['admin/forums', 'cid' => $cid]);
          }
          if ($model->load(Yii::$app->request->post())) {
              if ($model->save()) {
                  Log::info('Forum updated', $model->id, __METHOD__);
                  $this->success(Yii::t('podium/flash', 'Forum has been updated.'));
                  return $this->refresh();
              }
              $this->error(Yii::t('podium/flash', 'Sorry! There was an error while updating the forum.'));
          }
          return $this->render('forum', [
              'model' => $model,
              'forums' => Forum::find()->where(['category_id' => $cid])->orderBy(['sort' => SORT_ASC, 'id' => SORT_ASC])->all(),
              'categories' => Category::find()->orderBy(['sort' => SORT_ASC, 'id' => SORT_ASC])->all()
          ]);
      }
code: public function actionEditForum($cid = null, $id = null)
      {
          $model = Forum::find()->where(['id' => $id, 'category_id' => $cid])->limit(1)->one();
          if (empty($model)) {
              $this->error(Yii::t('podium/flash', 'Sorry! We can not find Forum with this ID.'));
              return $this->redirect(['admin/forums', 'cid' => $cid]);
          }
          if ($model->load(Yii::$app->request->post())) {
              if ($model->save()) {
                  Log::info('Forum updated', $model->id, __METHOD__);
                  $this->success(Yii::t('podium/flash', 'Forum has been updated.'));
                  return $this->refresh();
              }
              $this->error(Yii::t('podium/flash', 'Sorry! There was an error while updating the forum.'));
          }
          return $this->render('forum', [
              'model' => $model,
              'forums' => Forum::find()->where(['category_id' => $cid])->orderBy(['sort' => SORT_ASC, 'id' => SORT_ASC])->all(),
              'categories' => Category::find()->orderBy(['sort' => SORT_ASC, 'id' => SORT_ASC])->all()
          ]);
      }
code_tokens: public function actionEditForum ( $ cid = null , $ id = null ) { $ model = Forum :: find ( ) -> where ( [ 'id' => $ id , 'category_id' => $ cid ] ) -> limit ( 1 ) -> one ( ) ; if ( empty ( $ model ) ) { $ this -> error ( Yii :: t ( 'podium/flash' , 'Sorry! We can not find Forum with this ID.' ) ) ; return $ this -> redirect ( [ 'admin/forums' , 'cid' => $ cid ] ) ; } if ( $ model -> load ( Yii :: $ app -> request -> post ( ) ) ) { if ( $ model -> save ( ) ) { Log :: info ( 'Forum updated' , $ model -> id , __METHOD__ ) ; $ this -> success ( Yii :: t ( 'podium/flash' , 'Forum has been updated.' ) ) ; return $ this -> refresh ( ) ; } $ this -> error ( Yii :: t ( 'podium/flash' , 'Sorry! There was an error while updating the forum.' ) ) ; } return $ this -> render ( 'forum' , [ 'model' => $ model , 'forums' => Forum :: find ( ) -> where ( [ 'category_id' => $ cid ] ) -> orderBy ( [ 'sort' => SORT_ASC , 'id' => SORT_ASC ] ) -> all ( ) , 'categories' => Category :: find ( ) -> orderBy ( [ 'sort' => SORT_ASC , 'id' => SORT_ASC ] ) -> all ( ) ] ) ; }
docstring: Editing the forum of given ID.
  @param int $cid parent category ID
  @param int $id forum ID
  @return string|Response
docstring_tokens: Editing the forum of given ID .