public function actionCategory($id) { $model = Categories::findOne($id); $category = $model->find()->where(['id' => $id])->one(); $news = new News(); $data = $news->fromCategory($id, 20, $this->paging(20)); $datat1 = $news->fromCategory($id, 5, 0); $datat2 = $news->fromCategory($id, 4, 5); return $this->render('itemcategory', ['data' => $data, 'datat1' => $datat1, 'datat2' => $datat2, 'category' => $category, 'model' => $model]); }