adamwathan / bootforms

Rapid form generation with Bootstrap 3 and Laravel.
MIT License
417 stars 103 forks source link

Passing array of options to select #40

Closed Karel-Kroeze closed 9 years ago

Karel-Kroeze commented 9 years ago
BootForm::select()

Does not properly handle an array as the second argument. e.g. the default Laravel form builder; {{ Form::select('provider_id', $providers) }} works fine, but: {{ BootForm::select('provider_id', $providers) }} Throws a fatal error;

Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_ERROR)
Method AdamWathan\Form\Elements\Label::__toString() must not throw an exception 

The manual at https://github.com/adamwathan/form#selects implies that it should work, assuming the syntax is the same for BootForm.

Karel-Kroeze commented 9 years ago

I'm an idiot. I had omitted the label, took me looking up the source code to find that obvious error. Thanks for an awesome, extremely time-saving package!