Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function actionView($id){
- $comment = new Comments();
- $article = Blog::find()->where(['id' => $id])->all();
- $query = Comments::find()->where(['page' => $id]);
- // $query = Comments::find()->where('body=page',['page'=>$id]);
- $dataProvider = new ActiveDataProvider([
- 'query' => $query,
- 'pagination' => [
- 'pageSize' => 10,
- ]
- ]);
- if ($comment->load(Yii::$app->request->post()) && $comment->post()) {
- return $this->refresh();
- }
- return $this->render('view', [
- 'article' => $article,
- 'dataProvider' => $dataProvider,
- 'comment' => $comment,
- ]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement