/** * @param $id String The Id and the name attribute for the button * @param $label String The label for the input field * @param $value * @param $options * @return HTMLElement */ function getButton($id, $label, $value, $options = []) { $formGroup = new HTMLElement('div', false, ['class' => 'form-group']); $colInput = new HTMLElement('div', false, ['class' => 'col-md-8']); $labelElement = new HTMLElement('label', false, ['class' => 'col-md-4 control-label text-left', 'for' => $id]); $labelText = new HTMLText($label); $labelElement->addChildren($labelText); $formGroup->addChildren($labelElement); $formGroup->addChildren($colInput); $attributes = ['name' => $id, 'id' => $id, 'class' => 'btn btn-primary', 'value' => $value, 'type' => 'submit']; $element = new HTMLElement('input', false, $attributes); $colInput->addChildren($element); return $formGroup; }