Skip to content

Commit

Permalink
.btn class added for submit, reset and button elements.
Browse files Browse the repository at this point in the history
  • Loading branch information
saranga-kraken committed Jan 11, 2016
1 parent 7180d5a commit 5e85616
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/Manavo/BootstrapForms/FormBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ public function input($type, $name, $value = null, $options = [])
// Don't add form-control for some input types (like submit, checkbox, radio)
if (!in_array($type, ['submit', 'checkbox', 'radio', 'reset', 'file'])) {
$options = $this->appendClassToOptions('form-control', $options);
} else if (in_array($type, ['submit', 'reset'])) {
$options = $this->appendClassToOptions('btn', $options);
}

// Call the parent input method so that Laravel can handle
Expand Down Expand Up @@ -310,7 +312,21 @@ public function plainTextarea($name, $value = null, $options = [])
{
return parent::textarea($name, $value, $options);
}


/**
* Create a button element.
*
* @param string $value
* @param array $options
* @return string
*/
public function button($value = null, $options = array())
{
$options = $this->appendClassToOptions('btn', $options);

return parent::button($value, $options);
}

/**
* Append the given class to the given options array.
*
Expand Down

0 comments on commit 5e85616

Please sign in to comment.