adamwathan / bootforms

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

New Feature, insert input-group in controls #21

Closed moura137 closed 10 years ago

moura137 commented 10 years ago
BootForm::text('Username', 'username')->inputGroup()->beforeAddon('@')

BootForm::text('Site', 'site')->inputGroup()->afterAddon('.com.br')
colindecarlo commented 10 years ago

I think this is a good start on bringing input groups into BootForms. I'm curious however why you decided to make the input group a part of the FormGroup instead of leaving it as just another control? I think that adding it to the FormGroup adds some unnecessary complexity and muddies the overall API. I just don't see the advantage to creating a Text control and then converting it to an InputGroup via the FormGroup, why not just create an InputGroup at the start?

The usage could change from

BootForm::text('Username', 'username')->inputGroup()->beforeAddon('@');
BootForm::text('Site', 'site')->inputGroup()->afterAddon('.com.br');

to

BootForm::inputGroup('Username', 'username')->beforeAddon('@');
BootForm::inputGroup('Site', 'site')->afterAddon('.com.br');

I'm looking forward to using this my own projects!

moura137 commented 10 years ago

I thought of making this, for let free the use with other elements, example the password. Also added the builder the option of sending a class to Input Group.

BootForm::password('Password', 'password')->inputGroup('input-group-lg')->beforeAddon('ico');

How @colindecarlo said, is a start and also I look forward to using. Would like everyone's help thanks.

adamwathan commented 10 years ago

Would you mind resubmitting this pull request against the input-groups branch that I just created? I will merge it in there as a starting point and we can collaborate on it until we've got something we all think is awesome and can merge into master.

Thanks for the PR man!

moura137 commented 10 years ago

@adamwathan I created a branch input-groups in my fork and did the merge. Now I do not know how to relate in github, pull request actual need to be closed? Can you help me what should I do?

Thanks

colindecarlo commented 10 years ago

@moura137 yes, you're going to have to open a new pull request of your input-groups branch against the input-groups branch in this repo. Then either @adamwathan or yourself can close this PR. It's probably a good idea to reference this PR in the description of the new PR.

PROCESS!

adamwathan commented 10 years ago

No worries I was able to do it myself and push it to that branch. I'll open a PR from that branch and reference this discussion there.