manavo / laravel-bootstrap-forms

ABANDONED - Using @stidges' code for bootstrap forms to create a composer package.

Home Page:http://blog.stidges.com/post/easy-bootstrap-forms-in-laravel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reset caputed by form-control

sdh100shaun opened this issue · comments

if you use

 {{ Form::reset('Cancel',array('class'=>'btn btn-default')) }}

it appears to be getting caught by the form-control decoration - I am assuming cos of this (Formbuilder:73)

public function input($type, $name, $value = null, $options = array())
    {
        // Don't add form-control for some input types (like submit, checkbox, radio)
        if (!in_array($type, ['submit', 'checkbox', 'radio'])) {
            $options = $this->appendClassToOptions('form-control', $options);
        }

        // Call the parent input method so that Laravel can handle
        // the rest of the input set up.
        return parent::input($type, $name, $value, $options);
    }

Can you please amend that to

public function input($type, $name, $value = null, $options = array())
    {
        // Don't add form-control for some input types (like submit, checkbox, radio)
        if (!in_array($type, ['submit', 'checkbox', 'radio','reset'])) {
            $options = $this->appendClassToOptions('form-control', $options);
        }

        // Call the parent input method so that Laravel can handle
        // the rest of the input set up.
        return parent::input($type, $name, $value, $options);
    }

Thanks for this! Added it to the list, and re-tagged. A composer update should fix it!