From 136f3693f9f30dbeb54c02fece4f89f105a68ec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 19 Jan 2021 20:21:44 +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/GiiModel.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Gii/GiiModel.php b/Gii/GiiModel.php index 678849ef..4d95cc95 100644 --- a/Gii/GiiModel.php +++ b/Gii/GiiModel.php @@ -122,20 +122,21 @@ class ' . $managerName . ' extends ActiveRecord } + if ($property->hasType()) { + $type = $property->getType() . ' $' . $key . ' = ' . $val . ';' . "\n"; + } else { + $type = ' $' . $key . ' = ' . $val . ';' . "\n"; + } + if ($property->isStatic()) { $html .= ' - ' . $debug . ' static $' . $key . ' = ' . $val . ';' . "\n"; + ' . $debug . ' static ' . $type; } else { if ($key == 'primary') { continue; } - if ($property->hasType()) { - $html .= ' - ' . $debug . ' ' . $property->getType() . ' $' . $key . ' = ' . $val . ';' . "\n"; - } else { - $html .= ' - ' . $debug . ' $' . $key . ' = ' . $val . ';' . "\n"; - } + $html .= ' + ' . $debug . ' ' . $type; } }