dwightwatson / bootstrap-form

Bootstrap 3 form builder for Laravel
MIT License
217 stars 133 forks source link

Passing null to label attribute is causing an error in the label #77

Closed MichaelHoughton closed 7 years ago

MichaelHoughton commented 7 years ago

If the following is entered in:

echo BootForm::text('meta_description', null);

It outputs the label as: "Meta_Description"

Rather than "Meta Description"

Please feel free to assign this issue to me and I will solve it.

dwightwatson commented 7 years ago

Sounds like Str::title just capitalises the start of each word. Not what I expected. Unless you can think of a better solution, maybe it should just replace any underscores with spaces as well?

MichaelHoughton commented 7 years ago

Replacing underscores with spaces is exactly the first that will be required here :)

I can do a PR request for this if you like?

dwightwatson commented 7 years ago

Ah sorry, just saw your edit. I just pushed the change through as I still had the code open in Sublime.

MichaelHoughton commented 7 years ago

No problem - that's why I wanted to ask first - just incase you were already one it! And perfect fix too - thanks for this!