splitButtonDropdown() публичный статический Метод

Generates a button with a split dropdown menu.
public static splitButtonDropdown ( string $label, array $items, array $htmlOptions = [] ) : string
$label string the button label text.
$items array the menu items.
$htmlOptions array additional HTML attributes.
Результат string the generated button.
Пример #1
0
 public function testSplitButtonDropdown()
 {
     $I = $this->codeGuy;
     $items = array(array('label' => 'Action', 'url' => '#'), array('label' => 'Another action', 'url' => '#'), array('label' => 'Something else here', 'url' => '#'), TbHtml::menuDivider(), array('label' => 'Separate link', 'url' => '#'));
     $html = TbHtml::splitButtonDropdown('Action', $items);
     $group = $I->createNode($html, 'div.btn-group');
     $I->seeNodeChildren($group, array('a.btn', 'button.dropdown-toggle', 'ul.dropdown-menu'));
     CHtml::$count = 0;
 }
Пример #2
0
echo TbHtml::textField('appendedPrependedDropdownButton', '', array('prepend' => TbHtml::buttonDropdown('Action', $dropdownConfig), 'append' => TbHtml::buttonDropdown('Action', $dropdownConfig), 'span' => 2));
?>
    </div>
    <pre class="prettyprint linenums">
&lt;?php echo TbHtml::textField('appendedPrependedDropdownButton', '', array(
    'prepend' => TbHtml::buttonDropdown('Action', array(...)),
    'append' => TbHtml::buttonDropdown('Action', array(..)),
    'span' => 2,
)); ?></pre>

    <div class="bs-docs-example">
        <?php 
echo TbHtml::textField('prependedSplitDropdownButton', '', array('prepend' => TbHtml::splitButtonDropdown('Action', $dropdownConfig)));
?>
        <?php 
echo TbHtml::textField('appendedSplitDropdownButton', '', array('append' => TbHtml::splitButtonDropdown('Action', $dropdownConfig)));
?>
    </div>
<pre class="prettyprint linenums">
&lt;?php echo TbHtml::textField('prependedSplitDropdownButton', '',
    array('prepend' => TbHtml::splitButtonDropdown('Action', array(...)))); ?>
&lt;?php echo TbHtml::textField('appendedSplitDropdownButton', '',
    array('append' => TbHtml::splitButtonDropdown('Action', array(...)))); ?></pre>

    <h4>Search form</h4>

    <div class="bs-docs-example">
        <?php 
echo TbHtml::beginFormTb(TbHtml::FORM_LAYOUT_SEARCH);
?>
        <?php 
Пример #3
0
 public function testSplitButtonDropdownLinkButtons()
 {
     $I = $this->codeGuy;
     $items = array(array('label' => 'Action', 'url' => '#'), array('label' => 'Another action', 'url' => '#'), array('label' => 'Something else here', 'url' => '#'), TbHtml::menuDivider(), array('label' => 'Separate link', 'url' => '#'));
     $html = TbHtml::splitButtonDropdown('Action', $items, array('type' => array(TbHtml::BUTTON_TYPE_LINKBUTTON, TbHtml::BUTTON_TYPE_LINK)));
     $group = $I->createNode($html, 'div.btn-group');
     $I->seeNodeChildren($group, array('a.btn', 'a.dropdown-toggle', 'ul.dropdown-menu'));
     $a = $group->filter('a.btn');
     $I->seeNodeAttributes($a, array('href' => '#'));
     CHtml::$count = 0;
 }