From e53fbc86b4939cac0f9ce84cd731f85fc104d6e0 Mon Sep 17 00:00:00 2001 From: michaelantipenko Date: Wed, 6 Apr 2016 11:51:02 +0300 Subject: [PATCH] Add $labelOptions for the Nav. --- Nav.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Nav.php b/Nav.php index bf755e455..65c25ee8a 100644 --- a/Nav.php +++ b/Nav.php @@ -105,7 +105,10 @@ class Nav extends Widget * Defaults to `null` which means `` will be used. To disable the caret, set this property to be an empty string. */ public $dropDownCaret; - + /** + * @var array the HTML attributes for the label tag. + */ + public $labelOptions = []; /** * Initializes the widget. @@ -166,7 +169,7 @@ public function renderItem($item) } $encodeLabel = isset($item['encode']) ? $item['encode'] : $this->encodeLabels; $label = $encodeLabel ? Html::encode($item['label']) : $item['label']; - $options = ArrayHelper::getValue($item, 'options', []); + $options = isset($item['options']) ? $item['options'] : $this->labelOptions; $items = ArrayHelper::getValue($item, 'items'); $url = ArrayHelper::getValue($item, 'url', '#'); $linkOptions = ArrayHelper::getValue($item, 'linkOptions', []);