From c4df5883362c0236ebabadbe969b99858f215cf9 Mon Sep 17 00:00:00 2001 From: iron Date: Tue, 3 Sep 2019 17:28:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A4=84=E7=90=86=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vendor/blobt/widgets/Menu.php | 3 ++- yii | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100755 yii diff --git a/vendor/blobt/widgets/Menu.php b/vendor/blobt/widgets/Menu.php index 6a362b4..13e2dfa 100644 --- a/vendor/blobt/widgets/Menu.php +++ b/vendor/blobt/widgets/Menu.php @@ -186,13 +186,14 @@ class Menu extends Widget { */ protected function renderItems($items) { $lines = []; + $n = count($items); foreach ($items as $i => $item) { /* 获取菜单项的自定义属性 */ $options = array_merge($this->itemOptions, ArrayHelper::getValue($item, 'options', [])); $tag = ArrayHelper::remove($options, 'tag', 'li'); $class = []; - if ($item['active']) { + if (isset($item['active'])) { $class[] = $this->activeCssClass; if (isset($item['items'])) { $class[] = $this->menuOpenClass; diff --git a/yii b/yii new file mode 100755 index 0000000..b93b5cf --- /dev/null +++ b/yii @@ -0,0 +1,24 @@ +#!/usr/bin/env php +run(); +exit($exitCode);