Skip to content

Commit

Permalink
Fix #428: Permit the usage of anonymous generators using dependency i…
Browse files Browse the repository at this point in the history
…njection
  • Loading branch information
aguevaraIL authored Apr 6, 2020
1 parent 6c63058 commit aa7a821
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Yii Framework 2 gii extension Change Log
2.2.1 under development
-----------------------

- no changes in this release.
- Bug #428: Permit the usage of anonymous generators using dependency injection (aguevaraIL)


2.2.0 March 24, 2020
Expand Down
7 changes: 6 additions & 1 deletion src/console/GenerateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
use Yii;
use yii\base\InlineAction;
use yii\console\Controller;
use yii\di\Instance;
use yii\gii\Generator;

/**
* This is the command line version of Gii - a code generator.
Expand Down Expand Up @@ -71,7 +73,10 @@ public function init()
{
parent::init();
foreach ($this->generators as $id => $config) {
$this->generators[$id] = Yii::createObject($config);
$this->generators[$id] = Instance::ensure(
$config,
Generator::className()
);
}
}

Expand Down

0 comments on commit aa7a821

Please sign in to comment.