Skip to content
This repository has been archived by the owner on Feb 26, 2018. It is now read-only.

Laravel 4 normalization #16

Open
barbuslex opened this issue Jun 4, 2014 · 7 comments
Open

Laravel 4 normalization #16

barbuslex opened this issue Jun 4, 2014 · 7 comments

Comments

@barbuslex
Copy link

Hi,

In laravel the names fields are always in first position and the value fields always in second...

To respect the Laravel's conventions it would be preferable to like this :

{{ BootForm::text('first_name', 'First Name') }}

Instead of this :

{{ BootForm::text('First Name', 'first_name') }}

Thanks

@adamwathan
Copy link
Owner

Yeah I think agree, big breaking change and a bit of a pain to update everything though, haha... Going to think about it for a bit.

@barbuslex
Copy link
Author

I make a fork with these changes :
https://github.com/barbuslex/bootforms

If you want pull request it for a future release ^^

@Grafikart
Copy link

Indeed changing everything would be a pain and a gain ^^

First lots of Framework with Form helpers set name first so it's a bit hard to change this habit to work with bootforms.

Secondly it's not possible to create a textfield without label :(
For instance :

BootForm::text($name)->placeholder('My placeholder');

But you are right this is a breaking change that will generate a lot of code change tests + code :(

@adamwathan
Copy link
Owner

I think I am gonna make the switch for 1.0 to be honest.

For the 'no label' thing, there is actually a hideLabel helper on master now, just not in a tagged release. Should tag soon.

So you can do:

BootForm::text('Name', $name)->placeholder('My placeholder')->hideLabel();

...which keeps your form nice and accessible for screen readers while still hiding the label in the DOM. Probably the better solution than just using a placeholder with no label anyways :)

@Grafikart
Copy link

When you start working on this 1.0 comment this issue I could help ^^

Indeed your hideLabel() thing is a good idea but some clients don't care about accessibility and making the label parameter optional (for the 1.0) could be a good shortcut.

@adamwathan
Copy link
Owner

Sounds good, help would be awesome!

Yeah that's an option, I really think the label should be specified and just hidden though. Doesn't matter if the client doesn't care, it's only a couple of extra keystrokes :)

The other thing is this package is really just meant for rapidly prototyping forms with Bootstrap, and not really meant to fulfill all the custom needs someone might have on something when they are really optimizing the user experience on a form. At that point it's better to just use adamwathan/form and build the Bootstrap markup yourself. Trying to keep this one simple :)

@Grafikart
Copy link

You convinced me ^^

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants