mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-14 06:11:35 +08:00
Fixes #3251: controller should be created using DI container.
This commit is contained in:
@ -531,7 +531,7 @@ class Module extends ServiceLocator
|
||||
}
|
||||
|
||||
if (is_subclass_of($className, 'yii\base\Controller')) {
|
||||
return new $className($id, $this);
|
||||
return Yii::createObject($className, [$id, $this]);
|
||||
} elseif (YII_DEBUG) {
|
||||
throw new InvalidConfigException("Controller class must extend from \\yii\\base\\Controller.");
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user