adamwathan / bootforms

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

add Htmlable, so the cleaner {{ can be used instead of {!! #112

Closed bussnet closed 7 years ago

bussnet commented 8 years ago

Make all Elements/Groups Htmlable so the Helper can used "cleaner" {{ Form::text() }} instead of {!! Form::text() !!}

bussnet commented 8 years ago

laravel 5.x is needed, so travis failed at PHP5.4

jesseleite commented 8 years ago

I'm confused why you think it's dirty? {!! !!} is valid laravel syntax for displaying unescaped data :)

Would you ever wrap renderable HTML in htmlentities()? ie.

<?php echo htmlentities('<input type="text" name="my-input">') ?>
bussnet commented 8 years ago

Dirty is wrong, thats why I use " ;)

But it's a lot cleaner to use {{ }}, because:

So I think it's not dirty, but cleaner and better is to use {{ }}

jesseleite commented 8 years ago

Fair enough thanks! Personally, I don't feel dirty about using {!! !!}. The big red-box warning on Laravel docs isn't saying "don't use this", it's saying "be careful and don't use this everywhere". That said, the Htmlable feature in Laravel is intriguing.

Adam also made a good point in that Bootforms is framework agnostic. Maybe we can implement this in a way that's only loaded when the Laravel service provider is used? I'll leave this open for now.

bussnet commented 8 years ago

Adam also made a good point in that Bootforms is framework agnostic. Maybe we can implement this in a way that's only loaded when the Laravel service provider is used? I'll leave this open for now.

Thats a good point. I only thought about this in a laravel-context.

Sobak commented 7 years ago

Do you see any way for implementing this conditionally for Laravel? Or it just doesn't fit in your conception for this package?

adamwathan commented 7 years ago

I can't really think of any way to do it conditionally just for Laravel unfortunately. I mean there are ways, but it would just be so convoluted that I don't know it's worth it.