Skip to content

Commit

Permalink
Version 2.1.22
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhirtz committed Feb 1, 2024
1 parent 69cdd39 commit 9b534a0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
14 changes: 14 additions & 0 deletions src/base/Module.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace davidhirtz\yii2\skeleton\base;

class Module extends \yii\base\Module
{
public const EVENT_INIT = 'init';

public function init(): void
{
$this->trigger(self::EVENT_INIT);
parent::init();
}
}
5 changes: 1 addition & 4 deletions src/modules/admin/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"
*/
Expand Down Expand Up @@ -177,7 +175,6 @@ public function init(): void
}
}

$this->trigger(static::EVENT_AFTER_INIT);
parent::init();
}

Expand Down

0 comments on commit 9b534a0

Please sign in to comment.