From 115487a875408e6c00280f81a5aaf993d756c6da Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Mon, 4 Nov 2013 23:26:57 +0400 Subject: [PATCH] Fixes #1133: gii controller generator now uses application controllerNamespace as default value for "Controller Namespace" --- extensions/gii/generators/controller/Generator.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/extensions/gii/generators/controller/Generator.php b/extensions/gii/generators/controller/Generator.php index 660ffb4..f23bcd4 100644 --- a/extensions/gii/generators/controller/Generator.php +++ b/extensions/gii/generators/controller/Generator.php @@ -31,7 +31,7 @@ class Generator extends \yii\gii\Generator /** * @var string the namespace of the controller class */ - public $ns = 'app\controllers'; + public $ns; /** * @var string list of action IDs separated by commas or spaces */ @@ -40,6 +40,15 @@ class Generator extends \yii\gii\Generator /** * @inheritdoc */ + public function init() + { + parent::init(); + $this->ns = \Yii::$app->controllerNamespace; + } + + /** + * @inheritdoc + */ public function getName() { return 'Controller Generator';