From 5e85616552cd737d2804f350691bf415e0c2997a Mon Sep 17 00:00:00 2001 From: Saranga Abeykoon Date: Mon, 11 Jan 2016 10:50:28 +0530 Subject: [PATCH] .btn class added for submit, reset and button elements. --- src/Manavo/BootstrapForms/FormBuilder.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Manavo/BootstrapForms/FormBuilder.php b/src/Manavo/BootstrapForms/FormBuilder.php index 80de48a..32dbb7e 100644 --- a/src/Manavo/BootstrapForms/FormBuilder.php +++ b/src/Manavo/BootstrapForms/FormBuilder.php @@ -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 @@ -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. *