|
|
@ -22,18 +22,17 @@ use yii\helpers\Html; |
|
|
|
* 'label' => 'Action', |
|
|
|
* 'label' => 'Action', |
|
|
|
* 'items' => Dropdown::widget(array( |
|
|
|
* 'items' => Dropdown::widget(array( |
|
|
|
* 'clientOptions' => false, |
|
|
|
* 'clientOptions' => false, |
|
|
|
* 'items' => array( |
|
|
|
* 'items' => array( |
|
|
|
* array( |
|
|
|
* array( |
|
|
|
* 'label' => 'DropdownA', |
|
|
|
* 'label' => 'DropdownA', |
|
|
|
* 'url' => '/', |
|
|
|
* 'url' => '/', |
|
|
|
* ), |
|
|
|
* ), |
|
|
|
* array( |
|
|
|
* array( |
|
|
|
* 'label' => 'DropdownB', |
|
|
|
* 'label' => 'DropdownB', |
|
|
|
* 'url' => '#', |
|
|
|
* 'url' => '#', |
|
|
|
* ), |
|
|
|
* ), |
|
|
|
* ), |
|
|
|
|
|
|
|
* ), |
|
|
|
* ), |
|
|
|
* ), |
|
|
|
* )), |
|
|
|
* )); |
|
|
|
* )); |
|
|
|
* |
|
|
|
* |
|
|
|
* // split button group using `items` dropdown configuration |
|
|
|
* // split button group using `items` dropdown configuration |
|
|
@ -134,10 +133,12 @@ class Button extends Widget |
|
|
|
$splitButton = Html::tag('button', '<span class="caret"></span>', $this->buttonOptions); |
|
|
|
$splitButton = Html::tag('button', '<span class="caret"></span>', $this->buttonOptions); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$tag = 'a'; |
|
|
|
$tag = 'a'; |
|
|
|
|
|
|
|
$label .= ' <span class="caret"></span>'; |
|
|
|
$options = $this->buttonOptions; |
|
|
|
$options = $this->buttonOptions; |
|
|
|
if (!isset($options['href'])) { |
|
|
|
if (!isset($options['href'])) { |
|
|
|
$options['href'] = '#'; |
|
|
|
$options['href'] = '#'; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
$this->addCssClass($options, 'dropdown-toggle'); |
|
|
|
$options['data-toggle'] = 'dropdown'; |
|
|
|
$options['data-toggle'] = 'dropdown'; |
|
|
|
} |
|
|
|
} |
|
|
|
return Html::tag($tag, $label, $options) . "\n" . $splitButton; |
|
|
|
return Html::tag($tag, $label, $options) . "\n" . $splitButton; |
|
|
|