コード例 #1
0
 protected function findModel($id)
 {
     if (($model = ContactsSubjects::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
コード例 #2
0
 public function actionContacts()
 {
     return $this->render('contact', ['page' => Contacts::find()->where(['id' => 1])->one(), 'subjects' => ContactsSubjects::find()->all()]);
 }