Commit cfa25dd8 by Hisateru Tanaka

Bootstrap's dropdown encodes also trailing caret tag

parent 03451912
...@@ -75,6 +75,10 @@ class ButtonDropdown extends Widget ...@@ -75,6 +75,10 @@ class ButtonDropdown extends Widget
protected function renderButton() protected function renderButton()
{ {
Html::addCssClass($this->options, 'btn'); Html::addCssClass($this->options, 'btn');
$label = $this->label;
if ($this->encodeLabel) {
$label = Html::encode($label);
}
if ($this->split) { if ($this->split) {
$options = $this->options; $options = $this->options;
$this->options['data-toggle'] = 'dropdown'; $this->options['data-toggle'] = 'dropdown';
...@@ -85,7 +89,7 @@ class ButtonDropdown extends Widget ...@@ -85,7 +89,7 @@ class ButtonDropdown extends Widget
'options' => $this->options, 'options' => $this->options,
]); ]);
} else { } else {
$this->label .= ' <span class="caret"></span>'; $label .= ' <span class="caret"></span>';
$options = $this->options; $options = $this->options;
if (!isset($options['href'])) { if (!isset($options['href'])) {
$options['href'] = '#'; $options['href'] = '#';
...@@ -96,9 +100,9 @@ class ButtonDropdown extends Widget ...@@ -96,9 +100,9 @@ class ButtonDropdown extends Widget
} }
return Button::widget([ return Button::widget([
'tagName' => $this->tagName, 'tagName' => $this->tagName,
'label' => $this->label, 'label' => $label,
'options' => $options, 'options' => $options,
'encodeLabel' => $this->encodeLabel, 'encodeLabel' => false,
]) . "\n" . $splitButton; ]) . "\n" . $splitButton;
} }
......
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