From 99d3bc1d8a45d51688690afca68f18a5280dc05a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Thu, 25 Mar 2021 16:56:41 +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 | 4 ++-- Gii/GiiModel.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gii/GiiController.php b/Gii/GiiController.php index 4c845acf..0a212684 100644 --- a/Gii/GiiController.php +++ b/Gii/GiiController.php @@ -43,9 +43,9 @@ class GiiController extends GiiBase $managerName = str_replace(ucfirst($prefix), '', $managerName); $class = ''; - $controller = $namespace . '\\' . $managerName . 'Controller'; + $controller = "$namespace\{$managerName}Controller"; if (file_exists($path['path'] . '/' . $managerName . 'Controller.php')) { - $class = new \ReflectionClass($controller); + $class = Snowflake::getDi()->getReflect($controller); } $controllerName = $managerName; diff --git a/Gii/GiiModel.php b/Gii/GiiModel.php index 518cbcb9..eda5c19b 100644 --- a/Gii/GiiModel.php +++ b/Gii/GiiModel.php @@ -56,7 +56,7 @@ class GiiModel extends GiiBase if (file_exists($modelPath['path'] . '/' . $managerName . '.php')) { try { - $class = new \ReflectionClass($modelPath['namespace'] . '\\' . $managerName); + $class = Snowflake::getDi()->getReflect("{$modelPath['namespace']}\{$managerName}"); $html = $this->getUseContent($class, $classFileName); } catch (\Throwable $e) {