public function actionBack($id) { $model = FacultyRecord::findOne($id); $university_id = $model->university_id; return $this->redirect(['faculty/index', 'id' => $university_id]); }
/** * Finds the FacultyRecord model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return FacultyRecord the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = FacultyRecord::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }