带有 PUT 方法的 Laravel 表单 html 用于 PUT 路由
问题描述
我的路线中有这个:
现在,我想制作一个将使用 PUT 方法的表单 html.这是我的代码:
Now, i want to make a form html that will use PUT method. Here it is my codes:
但我无法将表单提交到 post.edit.
But i doesn't work to submit the form into post.edit.
我已经用谷歌搜索了,我得到了我必须使用的解决方案
I Have googled and i got solution that i must use
但是,我希望表单仍然可以通过 CSS 样式来完成.大佬们有解决办法吗?谢谢你
But, i want the form still can done by CSS styling. Is there any solution guys? Thank You
推荐答案
您可以添加 css 类,以及刀片模板所需的任何类型的属性,试试这个:
You CAN add css clases, and any type of attributes you need to blade template, try this:
如果您不想采用刀片方式,您可以添加隐藏输入.这是 Laravel 的形式,无论如何:
If you dont want to go the blade way you can add a hidden input. This is the form Laravel does, any way:
注意:由于 HTML 表单仅支持 POST 和 GET、PUT 和 DELETE方法将通过自动添加 _method 隐藏字段来进行欺骗到你的表格.(Laravel 文档)
Note: Since HTML forms only support POST and GET, PUT and DELETE methods will be spoofed by automatically adding a _method hidden field to your form. (Laravel docs)
这篇关于带有 PUT 方法的 Laravel 表单 html 用于 PUT 路由的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!