删除viewe目录的生成
This commit is contained in:
parent
055f3d5aa9
commit
db37e71782
@ -70,38 +70,9 @@ class CreateModuleCommand extends Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->output->info('🎉 create controller successfully');
|
$this->output->info('🎉 create controller successfully');
|
||||||
$this->createView($controllers);
|
|
||||||
$this->createRequest($controllers);
|
$this->createRequest($controllers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected function createView($controllers)
|
|
||||||
{
|
|
||||||
$viewPath = $this->moduleDir . 'view' . DIRECTORY_SEPARATOR;
|
|
||||||
|
|
||||||
CatchAdmin::makeDirectory($viewPath);
|
|
||||||
|
|
||||||
$default = ['index.', 'create.', 'edit.'];
|
|
||||||
|
|
||||||
$viewSuffix = config('view.view_suffix');
|
|
||||||
|
|
||||||
if (count($controllers) === 1) {
|
|
||||||
foreach ($default as $v) {
|
|
||||||
file_put_contents($viewPath . $v .$viewSuffix, '');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
foreach ($controllers as $controller) {
|
|
||||||
CatchAdmin::makeDirectory($viewPath . ucwords($controller));
|
|
||||||
foreach ($default as $v) {
|
|
||||||
file_put_contents($viewPath . ucwords($controller) . DIRECTORY_SEPARATOR .$v . $viewSuffix, '');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->output->info('🎉 create view successfully');
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function createRequest($controllers)
|
protected function createRequest($controllers)
|
||||||
{
|
{
|
||||||
$requestPath = $this->moduleDir . DIRECTORY_SEPARATOR . 'request' . DIRECTORY_SEPARATOR;
|
$requestPath = $this->moduleDir . DIRECTORY_SEPARATOR . 'request' . DIRECTORY_SEPARATOR;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user