bddevsclub / website

The website for bddevs
2 stars 4 forks source link

Reducing boilerplate form html #5

Closed nadimtuhin closed 9 years ago

nadimtuhin commented 9 years ago

We can use http://formers.github.io/former/ to ease our forming experience. Features

  1. hydrates error messages sent from controller
  2. preserves value on validation error redirection
  3. hydrates from model
  4. bootstrap2, bootstrap3 and zurb foundation style html output and flexible configuration
  5. automated csrf
masnun commented 9 years ago

Looks nice, we can use it if everyone agrees!

On Mon, Jun 29, 2015 at 4:42 AM, Nadim Tuhin notifications@github.com wrote:

We can use http://formers.github.io/former/ to ease our forming experience. Features

  1. hydrates error messages sent from controller
  2. preserves value on validation error redirection
  3. hydrates from model
  4. bootstrap2, bootstrap3 and zurb foundation style html output and flexible configuration

— Reply to this email directly or view it on GitHub https://github.com/bddevsclub/website/issues/5.

Abu Ashraf Masnun | +8801711960803 | http://masnun.me

milon commented 9 years ago

I think laravel's default form is good enough.

masnun commented 9 years ago

Laravel Collective Forms?

On Mon, Jun 29, 2015 at 9:26 AM, Nuruzzaman Milon notifications@github.com wrote:

I think laravel's default form is good enough.

— Reply to this email directly or view it on GitHub https://github.com/bddevsclub/website/issues/5#issuecomment-116412570.

Abu Ashraf Masnun | +8801711960803 | http://masnun.me

nadimtuhin commented 9 years ago

Obviously collective form is great. But I find it asks for lots of boilerplate code for each input.

  1. lots of html
  2. error messages boilerplate code
  3. boilerplate csrf code

Think we have 10 inputs in a page then it will be a 9*10 lines of code where it could been 9 lines of code with former. I find this approach better because when I need to add/remove/update inputs its faster and less error prone. One note though former behaves same as collective form through a config file change.

Also forms were removed from core for a reason. One good reason was former.

mnishihan commented 9 years ago

I'm a big fan of Formers. It reduces boilerplate code significantly. Let's use it without being democratic :-) On সোম, ২৯ জুন, ২০১৫ at ৪:৪৭ অপরাহ্ণ Nadim Tuhin notifications@github.com wrote:

Obviously collective html is great. But it asks for lots of boilerplate code for each input.

  1. lots of html
  2. error messages boilerplate code
  3. boilerplate csrf code

Think we have 10 inputs in a page then it will be a 9*10 lines of code where it could been 9 lines of code with former. I find this approach better because when I need to add/remove/update inputs its faster and less error prone.

Also forms were removed from core for a reason. One good reason was former.

— Reply to this email directly or view it on GitHub https://github.com/bddevsclub/website/issues/5#issuecomment-116602180.

masnun commented 9 years ago

OK, let's use it.

mnishihan commented 9 years ago

@nadimtuhin will you be able to do the necessary changes to move into a Former based implementation??

nadimtuhin commented 9 years ago

I am in :D doing it

sorry for the late answer. i was out for some family stuff

mnishihan commented 9 years ago

@nadimtuhin, please reference this issue with the PR for this :-)

nadimtuhin commented 9 years ago

ok vaia