public function actionIndex2() { $meetingModel = new MirMeeting(); $newMeetings = $meetingModel->find()->select("meeting_id,meeting_name")->orderBy('meeting_id desc')->limit(10)->all(); $id = Yii::$app->request->get("id"); $model = $meetingModel->findOne(["meeting_id" => $id]); // p($model); return $this->render('index2', ['newMeetings' => $newMeetings, 'model' => $model]); }
/** * Finds the MirMeeting model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return MirMeeting the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = MirMeeting::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }