public function actionAcceptBlogComment() { $model = new BlogComments(); if ($model->load(Yii::$app->request->post()) && $model->validate()) { // $model->validate(); // vd($model->getErrors()); $model->save(); $this->redirect('/shop/blog-detail?id=' . $model->blog_id); } else { //$this->refresh(); } }
/** * @return \yii\db\ActiveQuery */ public function getBlogComments() { return $this->hasMany(BlogComments::className(), ['parent_id' => 'id']); }