frontend/models/CommentForm.php
public function save()
    {
        if ($this->validate()) {
            $model = new Comment([
                'source_type' => $this->source_type,
                'source_id' => $this->source_id,
                'user_id' => Yii::$app->user->id,
                'content' => $this->content,
            ]);
            return $model->save();
        }
        return false;
    }
public function save()
    {
        if ($this->validate()) {
            $model = new Comment([
                'source_type' => $this->source_type,
                'source_id' => $this->source_id,
                'user_id' => Yii::$app->user->id,
                'content' => $this->content,
            ]);
            return $model->save();
        }
        return false;
    }
保存评论