News::find(), 'pagination' => [ 'pageSize' => 16, ], ]); return $this->render('index',[ 'dataProvider' => $dataProvider ]); } public function actionView($translit) { return $this->render('view', [ 'model' => $this->findModel($translit), ]); } protected function findModel($translit) { if (($model = News::findOne(["code"=>$translit])) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } } }