|
@@ -106,23 +106,23 @@ discard block |
|
|
block discarded – undo |
|
106
|
106
|
} |
|
107
|
107
|
} |
|
108
|
108
|
|
|
109
|
|
- $appModulesFolder = Yii::$app->basePath . DIRECTORY_SEPARATOR . 'modules'; |
|
110
|
|
- $moduleFolder = $appModulesFolder . DIRECTORY_SEPARATOR . $moduleName; |
|
|
109
|
+ $appModulesFolder = Yii::$app->basePath.DIRECTORY_SEPARATOR.'modules'; |
|
|
110
|
+ $moduleFolder = $appModulesFolder.DIRECTORY_SEPARATOR.$moduleName; |
|
111
|
111
|
|
|
112
|
112
|
if (file_exists($moduleFolder)) { |
|
113
|
|
- return $this->outputError("The folder " . $moduleFolder . " exists already."); |
|
|
113
|
+ return $this->outputError("The folder ".$moduleFolder." exists already."); |
|
114
|
114
|
} |
|
115
|
115
|
|
|
116
|
116
|
$folders = [ |
|
117
|
117
|
'basePath' => $moduleFolder, |
|
118
|
|
- 'adminPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'admin', |
|
119
|
|
- 'adminAwsPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR . 'aws', |
|
120
|
|
- 'adminMigrationPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR . 'migrations', |
|
121
|
|
- 'frontendPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'frontend', |
|
122
|
|
- 'frontendBlocksPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'frontend' . DIRECTORY_SEPARATOR . 'blocks', |
|
123
|
|
- 'frontendControllersPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'frontend' . DIRECTORY_SEPARATOR . 'controllers', |
|
124
|
|
- 'frontendViewsPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'frontend' . DIRECTORY_SEPARATOR . 'views', |
|
125
|
|
- 'modelsPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'models', |
|
|
118
|
+ 'adminPath' => $moduleFolder.DIRECTORY_SEPARATOR.'admin', |
|
|
119
|
+ 'adminAwsPath' => $moduleFolder.DIRECTORY_SEPARATOR.'admin'.DIRECTORY_SEPARATOR.'aws', |
|
|
120
|
+ 'adminMigrationPath' => $moduleFolder.DIRECTORY_SEPARATOR.'admin'.DIRECTORY_SEPARATOR.'migrations', |
|
|
121
|
+ 'frontendPath' => $moduleFolder.DIRECTORY_SEPARATOR.'frontend', |
|
|
122
|
+ 'frontendBlocksPath' => $moduleFolder.DIRECTORY_SEPARATOR.'frontend'.DIRECTORY_SEPARATOR.'blocks', |
|
|
123
|
+ 'frontendControllersPath' => $moduleFolder.DIRECTORY_SEPARATOR.'frontend'.DIRECTORY_SEPARATOR.'controllers', |
|
|
124
|
+ 'frontendViewsPath' => $moduleFolder.DIRECTORY_SEPARATOR.'frontend'.DIRECTORY_SEPARATOR.'views', |
|
|
125
|
+ 'modelsPath' => $moduleFolder.DIRECTORY_SEPARATOR.'models', |
|
126
|
126
|
]; |
|
127
|
127
|
|
|
128
|
128
|
$ns = 'app\\modules\\'.$moduleName; |
|
@@ -132,9 +132,9 @@ discard block |
|
|
block discarded – undo |
|
132
|
132
|
} |
|
133
|
133
|
|
|
134
|
134
|
$contents = [ |
|
135
|
|
- $moduleFolder. DIRECTORY_SEPARATOR . 'README.md' => $this->renderReadme($folders, $moduleName, $ns), |
|
136
|
|
- $moduleFolder. DIRECTORY_SEPARATOR . 'admin/Module.php' => $this->renderAdmin($folders, $moduleName, $ns), |
|
137
|
|
- $moduleFolder. DIRECTORY_SEPARATOR . 'frontend/Module.php' => $this->renderFrontend($folders, $moduleName, $ns), |
|
|
135
|
+ $moduleFolder.DIRECTORY_SEPARATOR.'README.md' => $this->renderReadme($folders, $moduleName, $ns), |
|
|
136
|
+ $moduleFolder.DIRECTORY_SEPARATOR.'admin/Module.php' => $this->renderAdmin($folders, $moduleName, $ns), |
|
|
137
|
+ $moduleFolder.DIRECTORY_SEPARATOR.'frontend/Module.php' => $this->renderFrontend($folders, $moduleName, $ns), |
|
138
|
138
|
]; |
|
139
|
139
|
|
|
140
|
140
|
foreach ($contents as $fileName => $content) { |