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();
     }
 }
Beispiel #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getBlogComments()
 {
     return $this->hasMany(BlogComments::className(), ['parent_id' => 'id']);
 }