frontend\modules\topic\controllers\CommentController::actionUpdate PHP Method

actionUpdate() public method

修改评论
public actionUpdate ( $id ) : string | Response
$id
return string | yii\web\Response
    public function actionUpdate($id)
    {
        $model = PostComment::findComment($id);
        if (!$model->isCurrent()) {
            throw new NotFoundHttpException();
        }
        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['/topic/default/view', 'id' => $model->post_id]);
        } else {
            return $this->render('update', ['model' => $model]);
        }
    }