Event::find() ]); return $this->render('index', [ 'dataProvider' => $dataProvider, ]); } public function actionShow($alias) { return $this->render('show', [ 'model' => $this->findModel($alias), ]); } protected function findModel($alias) { if (($model = Event::findOne(["alias"=>$alias])) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } } }