protected function findModel($id) { if (($model = ApplicationConfig::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
public function actionIndex() { $visitor = ApplicationConfig::findOne(1); return $this->render('index', ['visitor' => $visitor]); }