Laravel 表单 html 与 PUT 方法的 PUT 路由
我在我的路线上有这个:
+--------+---------------------------+--------------+--------------------------- ---------+----------------+---------------+
| Domain | URI | Name | Action | Before Filters | After Filters |
+--------+---------------------------+--------------+--------------------------- ---------+----------------+---------------+
| | GET|HEAD / | | postcontroller | auth | |
| | GET|HEAD login | | homecontroller@dologin | | |
| | POST login | | homecontroller@dologin | | |
| | GET|HEAD logout | | homecontroller@dologout | | |
| | GET|HEAD post | post.index | postcontroller@index | | |
| | GET|HEAD post/create | post.create | postcontroller@create | | |
| | POST post | post.store | postcontroller@store | | |
| | GET|HEAD post/{post} | post.show | postcontroller@show | | |
| | GET|HEAD post/{post}/edit | post.edit | postcontroller@edit | | |
| | PUT post/{post} | post.update | postcontroller@update | | |
| | PATCH post/{post} | | postcontroller@update | | |
| | DELETE post/{post} | post.destroy | postcontroller@destroy
现在,我想制作一个将使用PUT方法的html表单。这是我的代码:
<form class="col-md-12" action="<?php echo URL::to('/');?>/post/<?=$post->postID?>" method="put">
<div class="form-group">
<textarea type="text" class="form-control input-lg" placeholder="Text Here" name="post"><?=$post->post?></textarea>
</div>
<div class="form-group">
<button class="btn btn-primary btn-lg btn-block" type="submit" value="Edit">Edit</button>
</div>
</form>
但是我不起作用将表单提交到post.edit中。
我已经谷歌了,我得到了我必须使用的解决方案
{{form:...etc
但是,我希望表单仍然可以通过CSS样式完成。有什么解决方案吗?谢谢