From 9b534a022a0b64a27a0ba6854e08b2d528beb8d6 Mon Sep 17 00:00:00 2001 From: davidhirtz Date: Thu, 1 Feb 2024 12:46:59 +0100 Subject: [PATCH] Version 2.1.22 --- CHANGELOG.md | 4 ++++ src/base/Module.php | 14 ++++++++++++++ src/modules/admin/Module.php | 5 +---- 3 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 src/base/Module.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 12cc3af3..02efe1e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.1.22 (Feb 1, 2024) + +- Added `Module::EVENT_INIT` for better module manipulation from extensions + ## 2.1.21 (Feb 1, 2024) - Added `CreateValidatorsEvent` to simplify the creation of validators from behaviors diff --git a/src/base/Module.php b/src/base/Module.php new file mode 100644 index 00000000..c240ec07 --- /dev/null +++ b/src/base/Module.php @@ -0,0 +1,14 @@ +trigger(self::EVENT_INIT); + parent::init(); + } +} diff --git a/src/modules/admin/Module.php b/src/modules/admin/Module.php index 9cafeaa3..568b634e 100644 --- a/src/modules/admin/Module.php +++ b/src/modules/admin/Module.php @@ -14,10 +14,8 @@ use davidhirtz\yii2\skeleton\modules\admin\controllers\UserLoginController; use Yii; -class Module extends \yii\base\Module +class Module extends \davidhirtz\yii2\skeleton\base\Module { - public const EVENT_AFTER_INIT = 'afterInit'; - /** * @var string|null the module display name, defaults to "Admin" */ @@ -177,7 +175,6 @@ public function init(): void } } - $this->trigger(static::EVENT_AFTER_INIT); parent::init(); }