Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Remove the laravelcollective/html package #195

Open
euantorano opened this issue Mar 17, 2016 · 14 comments
Open

Remove the laravelcollective/html package #195

euantorano opened this issue Mar 17, 2016 · 14 comments

Comments

@euantorano
Copy link
Member

I'm not sure what the original intent was, but we should remove laravelcollective/html. It makes things unduly complex and difficult. For instance, one is limited when opening a form to the following:

{{ form_open({'route': ['topics.reply', topic.id, topic.slug], 'method': 'post', 'id': 'topicreply'}) }}

You cannot instead do:

{{ form_open({'route': ['topics.reply', {'id': topic.id, 'slug': topic.slug}], 'method': 'post', 'id': 'topicreply'}) }}

Constructing a <form> tag isn't difficult, so there's not much use for the library in my opinion.

@Nik101010
Copy link

You could use

form_open({'url': url_route('topics.reply', {'slug': topic.slug, 'id': topic.id}), 'method': 'post', 'id': 'quickreply'})

to generate forms ^^ looks ugly ...

@euantorano
Copy link
Member Author

Yeah, it's easier to just use the proper tag IMO. Gets rid of a dependency too hopefully.

@Nik101010
Copy link

Maybe it's easier for inputs, because you can more easily define the selected element and don't have to write an if clause every time ... (not sure though if there is an easier way with twig) https://github.com/mybb/mybb2/blob/master/resources/views/admin/partials/users/profile_field_form.twig#L12 for example

@euantorano
Copy link
Member Author

Yeah, we could probably define a twig extensions for select boxes that just renders a template.

@ATofighi
Copy link
Contributor

I personally prefer to use laravelcollective/html instead of using <form>... (it's easier for CSRF, selects and ...)

We can ask @LaravelCollective to add a way to use

{{ form_open({'route': ['topics.reply', {'id': topic.id, 'slug': topic.slug}], 'method': 'post', 'id': 'topicreply'}) }}

@euantorano
Copy link
Member Author

Either way, we need to be able to use a hash rather than relying on positional arguments.

@Nik101010
Copy link

@ATofighi there is the csrf_field() function for generating a csrf form field in laravel 5.2 ... no need to use laravelcollective/html for this ... A whole package just for two functions ...
Imo twig extensions for form opening and selects are a better idea ...

@xaoseric
Copy link
Contributor

We could always do <form action="{!! route('topics.reply', ['id' => topic.id, 'slug' => topic.slug]) !!}" method="post">, that would be the proper way of doing it.

@euantorano
Copy link
Member Author

Yep, that's how I've been fixing it personally.

On 30 Mar 2016, at 15:51, Eric Hocking [email protected] wrote:

We could always do

, that would be the proper way of doing it.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub

@Matslom
Copy link
Contributor

Matslom commented Jun 26, 2016

It's will be removed and all forms will be created using normal html tags?
I've started doing user management in ACP. What way i should create forms?

@euantorano
Copy link
Member Author

Yes, that's the plan. To create forms, you should write the normal HTML for a form, and use {{ url_route() }} to crate the URL the form submits to 😄

@036
Copy link
Contributor

036 commented Nov 18, 2016

I agree with removing this is makes it unnecessarily complex, when has there even been a problem with writing standard HTML?

@Stefan-MyBB
Copy link

@036 Writing HTML isn't a problem but populating a form manually is more difficult. The package provides a convenient way to bind models to forms: https://laravelcollective.com/docs/5.3/html#form-model-binding

@AdrianKuriata
Copy link

Using laravel collective with vue is really big problem and not working together so if you want in the future use vue, you will need replace form created with collective to html forms.

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

No branches or pull requests

9 participants