/** * Lists all FacultyRecord models. * @return mixed */ public function actionIndex($id) { $data = $id; $searchModel = new FacultySearchModel(); $dataProvider = $searchModel->search($data); //$faculty_id=$dataProvider->id; $name = UniversityRecord::findOne($data); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'name' => $name]); }
/** * Finds the UniversityRecord model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return UniversityRecord the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = UniversityRecord::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }