From bd8fabb5abbb909d0afca8de8dc5ece1641cf408 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 19 Jan 2021 20:12:29 +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/GiiBase.php | 2 +- Gii/GiiModel.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Gii/GiiBase.php b/Gii/GiiBase.php index bbe53a35..9620f38b 100644 --- a/Gii/GiiBase.php +++ b/Gii/GiiBase.php @@ -174,7 +174,7 @@ abstract class GiiBase $content = file_get_contents($this->getFilePath($className)); $explode = explode(PHP_EOL, $content); - $exists = array_slice($explode, $fun->getStartLine() - 1, $fun->getEndLine() - $fun->getStartLine() + 1); + $exists = array_slice($explode, $fun->getStartLine(), $fun->getEndLine() - $fun->getStartLine() + 1); return implode(PHP_EOL, $exists); } diff --git a/Gii/GiiModel.php b/Gii/GiiModel.php index 1fdd8baf..97218f3c 100644 --- a/Gii/GiiModel.php +++ b/Gii/GiiModel.php @@ -167,7 +167,8 @@ class ' . $managerName . ' extends ActiveRecord if (!empty($attributes)) { foreach ($attributes as $attribute) { $over .= " - #[\"" . $attribute->getName() . "('" . implode('\',\'', $attribute->getArguments()) . "')] + #[\\" . $attribute->getName() . "('" . implode('\',\'', $attribute->getArguments()) . "')] + "; } }