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