Commit e1089618 by Alex-Code

Allow an item to choose if it's encoded.

parent 0711027e
...@@ -148,7 +148,8 @@ class Nav extends Widget ...@@ -148,7 +148,8 @@ class Nav extends Widget
if (!isset($item['label'])) { if (!isset($item['label'])) {
throw new InvalidConfigException("The 'label' option is required."); throw new InvalidConfigException("The 'label' option is required.");
} }
$label = $this->encodeLabels ? Html::encode($item['label']) : $item['label']; $encodeLabel = isset($item['encode']) ? $item['encode'] : $this->encodeLabels;
$label = $encodeLabel ? Html::encode($item['label']) : $item['label'];
$options = ArrayHelper::getValue($item, 'options', []); $options = ArrayHelper::getValue($item, 'options', []);
$items = ArrayHelper::getValue($item, 'items'); $items = ArrayHelper::getValue($item, 'items');
$url = ArrayHelper::getValue($item, 'url', '#'); $url = ArrayHelper::getValue($item, 'url', '#');
......
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