Pull all group of button into the form.

{@inheritdoc}
439466
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        foreach ($options['button_groups'] as $name => $config) {
            $builder->add($name, ButtonGroupType::class, $config);
        }
    }
80690
public function addButton($button)
    {
        $buttons = $this->buttons;

        // If buttons isn't an array, set it
        if (!is_array($buttons)) {
            $buttons = array();
        }

        $buttons[] = $button;

        $this->buttons = $buttons;

        return $this;
    }
105327
public function buttons($buttons)
    {
        if ($buttons instanceof Closure) {
            $buttons = $buttons($this);
        }

        if (!is_array($buttons)) {
            throw new Exception('子菜单必须是数组或者匿名函数返回数组', 1);
        }

        $this->with('sub_button', $buttons);

        return $this;
    }
1200192
protected function buttonsViewData(FormRuleContext $context)
    {
        $buttonNames = $context->getButtons();

        $buttons = array();
        foreach ($buttonNames as $name) {
            $groups = $context->getGroup($name);

            $buttons[] = array(
                'name' => $name,
                'cancel' => count($groups) === 0,
                'validation_groups' => $groups,
            );
        }

        return $buttons;
    }
863236
function ()
	{
		var nButton;

		if ( typeof this.s.aoGroups != 'undefined' )
		{
			for ( var i=0, iLen=this.s.aoGroups.length ; i<iLen ; i++ )
			{
				nButton = this._fnDomGroupButton( i );
				this.dom.groupButtons.push( nButton );
				this.dom.buttons.push( nButton );
				this.dom.collection.appendChild( nButton );
			}
		}
	}
98356
protected function prepareForm(Form $form)
	{
		$form->getElementPrototype()->class[] = 'form-horizontal';
		$translator = $form->getTranslator();
		foreach ($form->controls as $control) {
			/** @var BaseControl $control */
			if ($control instanceof HiddenField) {
				continue;
			} elseif ($control instanceof Button) {
				$control->controlPrototype->class[] = "btn-block btn-lg";
			} else {
				if ($control->getLabel()) {
					$control->setAttribute('placeholder', $control->caption);
					if (empty($control->controlPrototype->attrs['title'])) {
						$control->setAttribute('title', $translator ? $translator->translate($control->caption) : $control->caption);
					}
					$control->getLabelPrototype()->attrs["style"] = "display:none";
				}
			}
		}
		BootstrapHelper::ApplyBootstrapToControls($form);
	}
806361
protected function buildInputGroup()
    {
        $props = $this->props;
        if ($props['tagOnly']) {
            return $props['input'];
        }
        if (!$props['addonBefore'] && !$props['addonAfter']) {
            return $props['input'];
        }
        if ($props['addonBefore']) {
            $addonClass = \preg_match('#<(a|button)\b#i', $props['addonBefore'])
                ? 'input-group-btn'
                : 'input-group-addon';
            $props['addonBefore'] = '<span class="'.$addonClass.'">'.$props['addonBefore'].'</span>';
        }
        if ($props['addonAfter']) {
            $addonClass = \preg_match('#<(a|button)\b#i', $props['addonAfter'])
                ? 'input-group-btn'
                : 'input-group-addon';
            $props['addonAfter'] = '<span class="'.$addonClass.'">'.$props['addonAfter'].'</span>';
        }
        // since default attribsInputGroup didn't exist it's a bit cumbersome to merge here
        $propsInputGroup = $this->mergeProps(array(
            array(
                'attribs' => array( 'class' => 'input-group' ), // name, type, & other "global" attributes
            ),
            array(
                'attribs' => isset($props['attribsInputGroup'])
                    ? $props['attribsInputGroup']
                    : array(),
            ),
        ));
        $attribsInputGroup = $propsInputGroup['attribs'];
        return '<div'.Html::buildAttribString($attribsInputGroup).'>'."\n"
                .$props['addonBefore']."\n"
                .$props['input']."\n"
                .$props['addonAfter']."\n"
            .'</div>';
    }
1259630
public function form_button($params) {
        if (!isset($params['field'])) {
            throw new \UnexpectedValueException("The field parameter is required.");
        }
        $value = isset($params['value']) ? $params['value'] : null;
        $attributes = isset($params['attrs']) ? $params['attrs'] : array();
        return Form::button($params['field'], $value, $attributes);
    }
428191
protected function findButtonByName($button)
    {
        if (! is_null($element = $this->find("input[type=submit][name='{$button}']")) ||
            ! is_null($element = $this->find("input[type=button][value='{$button}']")) ||
            ! is_null($element = $this->find("button[name='{$button}']"))) {
            return $element;
        }
    }
741686
protected function compile()
	{
		$buttons = new Helper\Buttons();
		$buttons->loadFromFieldset($this->buttons);
		$buttons->buttonStyle = $this->buttonStyle;

		$this->Template->buttons = $buttons;
	}
770660
public static function buttonGroup($button, $links)
    {
        foreach ($links as $key => $link) {
            $links[$key] = Html::beginTag('li')
                    . Html::a($link[0], $link[1], $link[2])
                . Html::endTag('li');
        }

        return Html::beginTag('div', ['class' => 'btn-group'])
                . Html::button($button[0], array_merge([
                    'type'=>"button",
                    'class'=>"btn btn-default dropdown-toggle",
                    'data-toggle'=>"dropdown",
                    'aria-haspopup'=>"true",
                    'aria-expanded'=>"false"
                ], $button[1]))
                . Html::beginTag('ul', ['class' => 'dropdown-menu'])
                    . implode('', $links)
                . Html::endTag('ul')
            . Html::endTag('div');
    }
1123819
public function submitted(Form $form)
	{
		if (!isset($form['group_action']['submit']) || !$form['group_action']['submit']->isSubmittedBy()) {
			return;
		}

		$values = $form->getValues();
		$values = $values['group_action'];

		if ($values->group_action === 0 || $values->group_action === null) {
			return;
		}

		/**
		 * @todo Define items IDs
		 */
		$http_ids = $form->getHttpData(Form::DATA_LINE | Form::DATA_KEYS, strtolower($this->datagrid->getName()) . '_group_action_item[]');
		$ids = array_keys($http_ids);

		$id = $values->group_action;
		$this->group_actions[$id]->onSelect($ids, isset($values->{$id}) ? $values->{$id} : null);

		$form['group_action']['group_action']->setValue(null);
	}
732107
public function formProperties()
    {
        $form = $this->form();
        $obj  = ($form instanceof ObjectContainerInterface) ? $form->obj() : null;

        $groupProperties = $this->groupProperties();
        $formProperties  = $this->parsedFormProperties();
        $propOptions     = $this->propertiesOptions();

        foreach ($formProperties as $propertyIdent => $formProperty) {
            if (in_array($propertyIdent, $groupProperties)) {
                if (!empty($propOptions[$propertyIdent])) {
                    $propertyOptions = $propOptions[$propertyIdent];

                    if (is_array($propertyOptions)) {
                        $formProperty->merge($propertyOptions);
                    }
                }

                if ($obj) {
                    $val = $obj[$propertyIdent];
                    $formProperty->setPropertyVal($val);
                }

                if (!$formProperty->l10nMode()) {
                    $formProperty->setL10nMode($this->l10nMode());
                }

                if ($formProperty instanceof FormInputInterface) {
                    $formProperty->setFormGroup($this);
                }

                yield $propertyIdent => $formProperty;

                if ($formProperty instanceof FormInputInterface) {
                    $formProperty->clearFormGroup();
                }
            }
        }
    }
1278537
public function getBetterButtonsActions() {
		$fields = parent::getBetterButtonsActions();
		$fields->push(BetterButtonCustomAction::create('resend','Resend')
			->setRedirectType(BetterButtonCustomAction::REFRESH)
		);

		$this->extend('updateBetterButtonsActions', $fields);
		
		return $fields;
	}
1367825
function finishGroup(&$group)
    {
        $separator = $group->_separator;
        if (is_array($separator)) {
            $count = count($separator);
            $html  = '';
            for ($i = 0; $i < count($this->_groupElements); $i++) {
                $html .= (0 == $i? '': $separator[($i - 1) % $count]) . $this->_groupElements[$i];
            }
        } else {
            if (is_null($separator)) {
                $separator = '&nbsp;';
            }
            $html = implode((string)$separator, $this->_groupElements);
        }
        if (!empty($this->_groupWrap)) {
            $html = str_replace('{content}', $html, $this->_groupWrap);
        }
        $this->_html   .= str_replace('{element}', $html, $this->_groupTemplate);
        $this->_inGroup = false;
    }
176577
protected function buildButtons()
    {
        if (!isset($this->buttonsParts['{intervalSelect}'])) {
            $this->buttonsParts['{intervalSelect}'] = $this->buildIntervalSelect();
        }

        if (!isset($this->buttonsParts['{aggregationSelect}'])) {
            $this->buttonsParts['{aggregationSelect}'] = $this->buildAggregationSelect();
        }

        return strtr($this->buttonsTemplate, $this->buttonsParts);
    }
111934
public function makeFormElements()
    {
        $formMethods = array();

        foreach($this->cache->getFields() as $name => $type)
        {
            $formalName = ucwords($name);

            // TODO: add remaining types
            switch($type)
            {
                case 'integer':
                   $element = "{{ Form::input('number', '$name') }}";
                    break;

                case 'text':
                    $element = "{{ Form::textarea('$name') }}";
                    break;

                case 'boolean':
                    $element = "{{ Form::checkbox('$name') }}";
                    break;

                default:
                    $element = "{{ Form::text('$name') }}";
                    break;
            }

            // Now that we have the correct $element,
            // We can build up the HTML fragment
            $frag = <<<EOT
        <li>
            {{ Form::label('$name', '$formalName:') }}
            $element
        </li>

EOT;

            $formMethods[] = $frag;
        }

        return implode(PHP_EOL, $formMethods);
    }