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