/** * Finds the Exclusives model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return Exclusives the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Exclusives::find()->with('properties')->where(['id' => $id])->one()) !== null) { return $model; } else { throw new NotFoundHttpException('Запрошенная страница не найдена.'); } }
/** * Lists all Exclusives models. * @return mixed */ public function actionIndex() { $dataProvider = new ActiveDataProvider(['query' => Exclusives::find()]); return $this->render('index', ['dataProvider' => $dataProvider]); }