Fixes #3251: controller should be created using DI container.

This commit is contained in:
Qiang Xue
2014-04-25 10:10:51 -04:00
parent 0a86091984
commit f48a7aedfa

View File

@ -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 {