Bootstrap\View\Helper\BootstrapFormHelper::dropdownButton PHP Method

dropdownButton() public method

$this->Form->$buttonGroup([ $this->Form->button($title, $options), $this->Html->dropdown($menu, []) ]);
public dropdownButton ( $title, array $menu = [], array $options = [] )
$title The text in the button
$menu array HTML tags corresponding to menu options (which will be wrapped into
  • tag). To add separator, pass 'divider'.
  • $options array Options for button
        public function dropdownButton($title, array $menu = [], array $options = [])
        {
            $options['type'] = false;
            $options['data-toggle'] = 'dropdown';
            $options = $this->addClass($options, "dropdown-toggle");
            return $this->buttonGroup([$this->button($title . ' <span class="caret"></span>', $options), $this->bHtml->dropdown($menu)]);
        }