diff --git a/Database/DatabasesProviders.php b/Database/DatabasesProviders.php index c6153199..01669c11 100644 --- a/Database/DatabasesProviders.php +++ b/Database/DatabasesProviders.php @@ -31,7 +31,7 @@ class DatabasesProviders extends Providers /** * @param $name - * @return DatabasesProviders + * @return Connection * @throws ConfigException * @throws Exception */ diff --git a/Gii/Gii.php b/Gii/Gii.php index a2de1c78..0e6cb152 100644 --- a/Gii/Gii.php +++ b/Gii/Gii.php @@ -51,7 +51,7 @@ class Gii * @throws ConfigException * @throws Exception */ - public function run($db, $input) + public function run(?Connection $db, $input) { $this->input = $input; if (!empty($db)) $this->db = $db; @@ -65,6 +65,18 @@ class Gii $task = new GiiTask(); $task->setInput($this->input); return $task->generate(); + case 'interceptor': + $task = new GiiInterceptor(); + $task->setInput($this->input); + return $task->generate(); + case 'limits': + $task = new GiiLimits(); + $task->setInput($this->input); + return $task->generate(); + case 'middleware': + $task = new GiiMiddleware(); + $task->setInput($this->input); + return $task->generate(); default: return $this->getModel($make, $input); } diff --git a/Gii/GiiInterceptor.php b/Gii/GiiInterceptor.php new file mode 100644 index 00000000..46b6ae35 --- /dev/null +++ b/Gii/GiiInterceptor.php @@ -0,0 +1,79 @@ +input->get('name', null); + if (empty($managerName)) { + throw new Exception('文件名称不能为空~'); + } + $html = 'input->get('name', null); + if (empty($managerName)) { + throw new Exception('文件名称不能为空~'); + } + $html = 'input->get('name', null); + if (empty($managerName)) { + throw new Exception('文件名称不能为空~'); + } + $html = '