mirror of
				https://github.com/yiisoft/yii2.git
				synced 2025-11-04 06:37:55 +08:00 
			
		
		
		
	Hide menu container tag when items is empty
This commit is contained in:
		@ -166,10 +166,12 @@ class Menu extends Widget
 | 
			
		||||
            $this->params = Yii::$app->request->getQueryParams();
 | 
			
		||||
        }
 | 
			
		||||
        $items = $this->normalizeItems($this->items, $hasActiveChild);
 | 
			
		||||
        if (!empty($items)) {
 | 
			
		||||
            $options = $this->options;
 | 
			
		||||
            $tag = ArrayHelper::remove($options, 'tag', 'ul');
 | 
			
		||||
            echo Html::tag($tag, $this->renderItems($items), $options);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Recursively renders the menu items (without the container tag).
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user