Browse Source

Fixes #1133: gii controller generator now uses application controllerNamespace as default value for "Controller Namespace"

tags/2.0.0-beta
Alexander Makarov 11 years ago
parent
commit
115487a875
  1. 11
      extensions/gii/generators/controller/Generator.php

11
extensions/gii/generators/controller/Generator.php

@ -31,7 +31,7 @@ class Generator extends \yii\gii\Generator
/** /**
* @var string the namespace of the controller class * @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 * @var string list of action IDs separated by commas or spaces
*/ */
@ -40,6 +40,15 @@ class Generator extends \yii\gii\Generator
/** /**
* @inheritdoc * @inheritdoc
*/ */
public function init()
{
parent::init();
$this->ns = \Yii::$app->controllerNamespace;
}
/**
* @inheritdoc
*/
public function getName() public function getName()
{ {
return 'Controller Generator'; return 'Controller Generator';

Loading…
Cancel
Save