示例#1
0
 /**
  * Finds the DctAge model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return DctAge the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     $model = DctAge::find()->with('dctAgeLocs')->where(['dct_age_id' => $id])->one();
     if ($model !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
示例#2
0
 /**
  * Lists all DctAge models.
  * @return mixed
  */
 public function actionIndex()
 {
     $dataProvider = new ActiveDataProvider(['query' => DctAge::find()]);
     return $this->render('index', ['dataProvider' => $dataProvider]);
 }