From dca32b0a13b5410788ad17be6cce159a41113620 Mon Sep 17 00:00:00 2001 From: Karson Date: Wed, 31 Oct 2018 19:22:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DForm=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=86=97=E4=BD=99form-control=E7=B1=BB=E7=9A=84BUG=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=89=88=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/config.php | 2 +- extend/fast/Form.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/application/config.php b/application/config.php index 47b3aac0..eae9a582 100755 --- a/application/config.php +++ b/application/config.php @@ -272,7 +272,7 @@ return [ //自动检测更新 'checkupdate' => false, //版本号 - 'version' => '1.0.0.20180911_beta', + 'version' => '1.0.0.20181031_beta', //API接口地址 'api_url' => 'https://api.fastadmin.net', ], diff --git a/extend/fast/Form.php b/extend/fast/Form.php index f7fe1fbc..f9f4e748 100644 --- a/extend/fast/Form.php +++ b/extend/fast/Form.php @@ -213,7 +213,7 @@ class FormBuilder if (!in_array($type, $this->skipValueTypes)) { $value = $this->getValueAttribute($name, $value); - $options['class'] = isset($options['class']) ? $options['class'] . ' form-control' : 'form-control'; + $options['class'] = isset($options['class']) ? $options['class'] . (stripos($options['class'], 'form-control') !== false ? '' : ' form-control') : 'form-control'; } $merge = compact('type', 'value', 'id'); @@ -317,7 +317,7 @@ class FormBuilder unset($options['size']); - $options['class'] = isset($options['class']) ? $options['class'] . ' form-control' : 'form-control'; + $options['class'] = isset($options['class']) ? $options['class'] . (stripos($options['class'], 'form-control') !== false ? '' : ' form-control') : 'form-control'; $options = $this->attributes($options); return '' . $this->escape($value) . ''; @@ -389,7 +389,7 @@ class FormBuilder foreach ($list as $value => $display) { $html[] = $this->getSelectOption($display, $value, $selected); } - $options['class'] = isset($options['class']) ? $options['class'] . ' form-control' : 'form-control'; + $options['class'] = isset($options['class']) ? $options['class'] . (stripos($options['class'], 'form-control') !== false ? '' : ' form-control') : 'form-control'; $options = $this->attributes($options); $list = implode('', $html);