From ba1deeb057f31e51eb262b1bae87cc630f4acbf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Thu, 25 Mar 2021 19:58:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gii/GiiController.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Gii/GiiController.php b/Gii/GiiController.php index c4f8d9f8..962e8c9a 100644 --- a/Gii/GiiController.php +++ b/Gii/GiiController.php @@ -92,18 +92,20 @@ use {$model_namespace}\\{$managerName}; "; - $default = ['actionLoadParam', 'actionAdd', 'actionUpdate', 'actionDetail', 'actionDelete', 'actionBatchDelete', 'actionList']; $funcNames = []; if (is_object($class)) { $html .= $this->getClassProperty($class); - $html .= $this->getClassMethods($class, $default); + $html .= $this->getClassMethods($class); } - if (!$this->input->get('--controller-empty', false)) { - foreach ($default as $key => $val) { - if (in_array($val, $funcNames)) continue; - $html .= $this->{'controllerMethod' . str_replace('action', '', $val)}($this->fields, $managerName, $managerName) . "\n"; + + $default = ['loadParam', 'actionAdd', 'actionUpdate', 'actionDetail', 'actionDelete', 'actionBatchDelete', 'actionList']; + + foreach ($default as $key => $val) { + if (str_contains($html, 'public function ' . $val . '(')) { + continue; } + $html .= $this->{'controllerMethod' . str_replace('action', '', $val)}($this->fields, $managerName, $managerName) . "\n"; } $html .= '