From 775377c17afea6e3547df579803c7ff6940dfb26 Mon Sep 17 00:00:00 2001 From: David Schwarz Date: Tue, 22 Nov 2022 04:34:16 +0100 Subject: [PATCH] added: new API feature 'setting' e.g. `$genug->setting->notFoundPageId` --- genug.php | 4 +++- genug_core/genug/api.php | 4 +++- genug_core/genug/setting/setting.php | 26 ++++++++++++++++++++++++++ genug_user/view/index.php | 2 +- 4 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 genug_core/genug/setting/setting.php diff --git a/genug.php b/genug.php index eed349d..2ea41bd 100644 --- a/genug.php +++ b/genug.php @@ -17,6 +17,7 @@ EntityNotFound as PageEntityNotFound, Repository as PageRepository, }; +use genug\Setting\Setting; use genug\Lib\EntityAndIdCache; use const genug\Setting\ { @@ -58,7 +59,8 @@ $pages, $requestedPage, $homePage, - $groups + $groups, + new Setting() ); })(); diff --git a/genug_core/genug/api.php b/genug_core/genug/api.php index 1e14706..6ed5531 100644 --- a/genug_core/genug/api.php +++ b/genug_core/genug/api.php @@ -11,6 +11,7 @@ RepositoryInterface as PageRepositoryInterface, Entity as PageEntity }; +use genug\Setting\Setting; /** * @@ -23,7 +24,8 @@ public function __construct( public readonly PageRepositoryInterface $pages, public readonly PageEntity $requestedPage, public readonly PageEntity $homePage, - public readonly GroupRepositoryInterface $groups + public readonly GroupRepositoryInterface $groups, + public readonly Setting $setting ) { } } diff --git a/genug_core/genug/setting/setting.php b/genug_core/genug/setting/setting.php new file mode 100644 index 0000000..8bb9fff --- /dev/null +++ b/genug_core/genug/setting/setting.php @@ -0,0 +1,26 @@ +all pages