Commit d2fcbcc0 by artur

Hide menu container tag when items is empty

parent 28949b3a
...@@ -166,9 +166,11 @@ class Menu extends Widget ...@@ -166,9 +166,11 @@ class Menu extends Widget
$this->params = Yii::$app->request->getQueryParams(); $this->params = Yii::$app->request->getQueryParams();
} }
$items = $this->normalizeItems($this->items, $hasActiveChild); $items = $this->normalizeItems($this->items, $hasActiveChild);
$options = $this->options; if (!empty($items)) {
$tag = ArrayHelper::remove($options, 'tag', 'ul'); $options = $this->options;
echo Html::tag($tag, $this->renderItems($items), $options); $tag = ArrayHelper::remove($options, 'tag', 'ul');
echo Html::tag($tag, $this->renderItems($items), $options);
}
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment