|
@ -186,13 +186,14 @@ class Menu extends Widget { |
|
|
*/ |
|
|
*/ |
|
|
protected function renderItems($items) { |
|
|
protected function renderItems($items) { |
|
|
$lines = []; |
|
|
$lines = []; |
|
|
|
|
|
$n = count($items); |
|
|
foreach ($items as $i => $item) { |
|
|
foreach ($items as $i => $item) { |
|
|
/* 获取菜单项的自定义属性 */ |
|
|
/* 获取菜单项的自定义属性 */ |
|
|
$options = array_merge($this->itemOptions, ArrayHelper::getValue($item, 'options', [])); |
|
|
$options = array_merge($this->itemOptions, ArrayHelper::getValue($item, 'options', [])); |
|
|
$tag = ArrayHelper::remove($options, 'tag', 'li'); |
|
|
$tag = ArrayHelper::remove($options, 'tag', 'li'); |
|
|
$class = []; |
|
|
$class = []; |
|
|
|
|
|
|
|
|
if ($item['active']) { |
|
|
|
|
|
|
|
|
if (isset($item['active'])) { |
|
|
$class[] = $this->activeCssClass; |
|
|
$class[] = $this->activeCssClass; |
|
|
if (isset($item['items'])) { |
|
|
if (isset($item['items'])) { |
|
|
$class[] = $this->menuOpenClass; |
|
|
$class[] = $this->menuOpenClass; |
|
|