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; }
echo TbHtml::textField('appendedPrependedDropdownButton', '', array('prepend' => TbHtml::buttonDropdown('Action', $dropdownConfig), 'append' => TbHtml::buttonDropdown('Action', $dropdownConfig), 'span' => 2)); ?> </div> <pre class="prettyprint linenums"> <?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"> <?php echo TbHtml::textField('prependedSplitDropdownButton', '', array('prepend' => TbHtml::splitButtonDropdown('Action', array(...)))); ?> <?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
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; }