src/View/Helper/FormHelper.php
public function dropdownButton($title, array $menu = [], array $options = []) {
        // List of options to send to the dropdown() method
        $optsForHtml = ['align'];
        $ulOptions = [];
        foreach ($optsForHtml as $opt) {
            if (isset($options[$opt])) {
                $ulOptions[$opt] = $options[$opt];
                unset($options[$opt]);
            }
        }
        $options += [
            'type' => false,
            'dropup' => false,
            'data-toggle' => 'dropdown'
        ];
        $dropup = $options['dropup'];
        unset($options['dropup']);

        $bGroupOptions = [];
        if ($dropup) {
            $bGroupOptions = $this->addClass($bGroupOptions, 'dropup');
        }

        $options = $this->addClass($options, 'dropdown-toggle');
        return $this->buttonGroup([
            $this->button($title.' <span class="caret"></span>', $options),
            $this->Html->dropdown($menu, $ulOptions)
        ], $bGroupOptions);

    }
public function dropdownButton($title, array $menu = [], array $options = []) {
        // List of options to send to the dropdown() method
        $optsForHtml = ['align'];
        $ulOptions = [];
        foreach ($optsForHtml as $opt) {
            if (isset($options[$opt])) {
                $ulOptions[$opt] = $options[$opt];
                unset($options[$opt]);
            }
        }
        $options += [
            'type' => false,
            'dropup' => false,
            'data-toggle' => 'dropdown'
        ];
        $dropup = $options['dropup'];
        unset($options['dropup']);

        $bGroupOptions = [];
        if ($dropup) {
            $bGroupOptions = $this->addClass($bGroupOptions, 'dropup');
        }

        $options = $this->addClass($options, 'dropdown-toggle');
        return $this->buttonGroup([
            $this->button($title.' <span class="caret"></span>', $options),
            $this->Html->dropdown($menu, $ulOptions)
        ], $bGroupOptions);

    }
public function dropdownButton ( $ title , array $ menu = [ ] , array $ options = [ ] ) { // List of options to send to the dropdown() method $ optsForHtml = [ 'align' ] ; $ ulOptions = [ ] ; foreach ( $ optsForHtml as $ opt ) { if ( isset ( $ options [ $ opt ] ) ) { $ ulOptions [ $ opt ] = $ options [ $ opt ] ; unset ( $ options [ $ opt ] ) ; } } $ options += [ 'type' => false , 'dropup' => false , 'data-toggle' => 'dropdown' ] ; $ dropup = $ options [ 'dropup' ] ; unset ( $ options [ 'dropup' ] ) ; $ bGroupOptions = [ ] ; if ( $ dropup ) { $ bGroupOptions = $ this -> addClass ( $ bGroupOptions , 'dropup' ) ; } $ options = $ this -> addClass ( $ options , 'dropdown-toggle' ) ; return $ this -> buttonGroup ( [ $ this -> button ( $ title . ' <span class="caret"></span>' , $ options ) , $ this -> Html -> dropdown ( $ menu , $ ulOptions ) ] , $ bGroupOptions ) ; }
Creates a dropdown button.

This function is a shortcut for:

```php
$this->Form->$buttonGroup([
$this->Form->button($title, $options),
$this->Html->dropdown($menu, [])
]);
```

@param string $title The text for the button.
@param array $menu HTML elements corresponding to menu options (which will be wrapped
into `<li>` tag). To add separator, pass 'divider'. See `BootstrapHtml::dropdown()`.
@param array $options Array of options for the button. See `button()`.

@return string A HTML string containing the button dropdown.
Creates a dropdown button .