From 055f3d5aa976ef99bd4a6021a8f600bb8ef507ec Mon Sep 17 00:00:00 2001 From: yanwenwu Date: Thu, 23 Jan 2020 16:55:51 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/catcher/command/ModelGeneratorCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extend/catcher/command/ModelGeneratorCommand.php b/extend/catcher/command/ModelGeneratorCommand.php index 92e062c..4cc2d5b 100644 --- a/extend/catcher/command/ModelGeneratorCommand.php +++ b/extend/catcher/command/ModelGeneratorCommand.php @@ -16,8 +16,8 @@ class ModelGeneratorCommand extends Command protected function configure() { $this->setName('create:model') - ->addArgument('model', Argument::REQUIRED, 'model name') ->addArgument('module', Argument::REQUIRED, 'module name') + ->addArgument('model', Argument::REQUIRED, 'model name') ->setDescription('create model'); } From db37e717828525a28cd267ac3b2dd344c820aa08 Mon Sep 17 00:00:00 2001 From: yanwenwu Date: Thu, 23 Jan 2020 16:57:46 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=88=A0=E9=99=A4viewe=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E7=9A=84=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../catcher/command/CreateModuleCommand.php | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/extend/catcher/command/CreateModuleCommand.php b/extend/catcher/command/CreateModuleCommand.php index 531b5b4..5e1b1d3 100644 --- a/extend/catcher/command/CreateModuleCommand.php +++ b/extend/catcher/command/CreateModuleCommand.php @@ -70,38 +70,9 @@ class CreateModuleCommand extends Command } $this->output->info('🎉 create controller successfully'); - $this->createView($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) { $requestPath = $this->moduleDir . DIRECTORY_SEPARATOR . 'request' . DIRECTORY_SEPARATOR;