From cfa25dd8986dd147963705ba4f73e41f14e748ce Mon Sep 17 00:00:00 2001 From: Hisateru Tanaka Date: Wed, 25 Dec 2013 22:54:12 +0900 Subject: [PATCH] Bootstrap's dropdown encodes also trailing caret tag --- extensions/yii/bootstrap/ButtonDropdown.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/extensions/yii/bootstrap/ButtonDropdown.php b/extensions/yii/bootstrap/ButtonDropdown.php index 095a93f..34d3ae2 100644 --- a/extensions/yii/bootstrap/ButtonDropdown.php +++ b/extensions/yii/bootstrap/ButtonDropdown.php @@ -75,6 +75,10 @@ class ButtonDropdown extends Widget protected function renderButton() { Html::addCssClass($this->options, 'btn'); + $label = $this->label; + if ($this->encodeLabel) { + $label = Html::encode($label); + } if ($this->split) { $options = $this->options; $this->options['data-toggle'] = 'dropdown'; @@ -85,7 +89,7 @@ class ButtonDropdown extends Widget 'options' => $this->options, ]); } else { - $this->label .= ' '; + $label .= ' '; $options = $this->options; if (!isset($options['href'])) { $options['href'] = '#'; @@ -96,9 +100,9 @@ class ButtonDropdown extends Widget } return Button::widget([ 'tagName' => $this->tagName, - 'label' => $this->label, + 'label' => $label, 'options' => $options, - 'encodeLabel' => $this->encodeLabel, + 'encodeLabel' => false, ]) . "\n" . $splitButton; }