public function config($name, $default = null) { if (($config = Config::find()->where(['name' => $name])->one()) !== null) { return $config->value; } return $default; }
protected function findModel($id) { if (($model = Config::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }