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