diff --git a/framework/yii/gii/generators/controller/Generator.php b/framework/yii/gii/generators/controller/Generator.php index 9de9c17..b7c4095 100644 --- a/framework/yii/gii/generators/controller/Generator.php +++ b/framework/yii/gii/generators/controller/Generator.php @@ -197,7 +197,7 @@ class Generator extends \yii\gii\Generator */ public function getModule() { - if (($pos = strpos($this->controller, '/')) !== false) { + if (($pos = strrpos($this->controller, '/')) !== false) { $id = substr($this->controller, 0, $pos); if (($module = Yii::$app->getModule($id)) !== null) { return $module; diff --git a/framework/yii/gii/generators/module/Generator.php b/framework/yii/gii/generators/module/Generator.php index 1b35db8..39c68f0 100644 --- a/framework/yii/gii/generators/module/Generator.php +++ b/framework/yii/gii/generators/module/Generator.php @@ -87,18 +87,17 @@ class Generator extends \yii\gii\Generator $output = <<The module has been generated successfully.

-

To access the module, you need to modify the application configuration as follows:

+

To access the module, you need to add this to your application configuration:

EOD; $code = <<array( + ...... + 'modules' => array( '{$this->moduleID}' => array( 'class' => '{$this->moduleClass}', ), ), - ...... -); + ...... EOD; return $output . '
' . highlight_string($code, true) . '
';