• <tfoot id='JnpFi'></tfoot>
  • <small id='JnpFi'></small><noframes id='JnpFi'>

    <i id='JnpFi'><tr id='JnpFi'><dt id='JnpFi'><q id='JnpFi'><span id='JnpFi'><b id='JnpFi'><form id='JnpFi'><ins id='JnpFi'></ins><ul id='JnpFi'></ul><sub id='JnpFi'></sub></form><legend id='JnpFi'></legend><bdo id='JnpFi'><pre id='JnpFi'><center id='JnpFi'></center></pre></bdo></b><th id='JnpFi'></th></span></q></dt></tr></i><div id='JnpFi'><tfoot id='JnpFi'></tfoot><dl id='JnpFi'><fieldset id='JnpFi'></fieldset></dl></div>

      • <bdo id='JnpFi'></bdo><ul id='JnpFi'></ul>

        <legend id='JnpFi'><style id='JnpFi'><dir id='JnpFi'><q id='JnpFi'></q></dir></style></legend>
      1. 带有 PUT 方法的 Laravel 表单 html 用于 PUT 路由

        Laravel form html with PUT method for PUT routes(带有 PUT 方法的 Laravel 表单 html 用于 PUT 路由)

            • <bdo id='fYy27'></bdo><ul id='fYy27'></ul>

                <tbody id='fYy27'></tbody>
            • <small id='fYy27'></small><noframes id='fYy27'>

                  <tfoot id='fYy27'></tfoot>

                  <i id='fYy27'><tr id='fYy27'><dt id='fYy27'><q id='fYy27'><span id='fYy27'><b id='fYy27'><form id='fYy27'><ins id='fYy27'></ins><ul id='fYy27'></ul><sub id='fYy27'></sub></form><legend id='fYy27'></legend><bdo id='fYy27'><pre id='fYy27'><center id='fYy27'></center></pre></bdo></b><th id='fYy27'></th></span></q></dt></tr></i><div id='fYy27'><tfoot id='fYy27'></tfoot><dl id='fYy27'><fieldset id='fYy27'></fieldset></dl></div>
                  <legend id='fYy27'><style id='fYy27'><dir id='fYy27'><q id='fYy27'></q></dir></style></legend>
                1. 本文介绍了带有 PUT 方法的 Laravel 表单 html 用于 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.这是我的代码:

                  Now, i want to make a form html that will use PUT method. Here it is my codes:

                  <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.

                  But i doesn't work to submit the form into post.edit.

                  我已经用谷歌搜索了,我得到了我必须使用的解决方案

                  I Have googled and i got solution that i must use

                  {{form:...etc
                  

                  但是,我希望表单仍然可以通过 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:

                  {{ Form::open(array('url' => '/', 'method' => 'PUT', 'class'=>'col-md-12')) }}
                  .... wathever code here
                  {{ Form::close() }}
                  

                  如果您不想采用刀片方式,您可以添加隐藏输入.这是 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)

                  <form class="col-md-12" action="<?php echo URL::to('/');?>/post/<?=$post->postID?>" method="POST">
                  
                      <!-- Rendered blade HTML form use this hidden. Dont forget to put the form method to POST -->
                  
                      <input name="_method" type="hidden" value="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>
                  

                  这篇关于带有 PUT 方法的 Laravel 表单 html 用于 PUT 路由的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                2. <tfoot id='Z6HxA'></tfoot>

                  <i id='Z6HxA'><tr id='Z6HxA'><dt id='Z6HxA'><q id='Z6HxA'><span id='Z6HxA'><b id='Z6HxA'><form id='Z6HxA'><ins id='Z6HxA'></ins><ul id='Z6HxA'></ul><sub id='Z6HxA'></sub></form><legend id='Z6HxA'></legend><bdo id='Z6HxA'><pre id='Z6HxA'><center id='Z6HxA'></center></pre></bdo></b><th id='Z6HxA'></th></span></q></dt></tr></i><div id='Z6HxA'><tfoot id='Z6HxA'></tfoot><dl id='Z6HxA'><fieldset id='Z6HxA'></fieldset></dl></div>
                3. <legend id='Z6HxA'><style id='Z6HxA'><dir id='Z6HxA'><q id='Z6HxA'></q></dir></style></legend>

                        <tbody id='Z6HxA'></tbody>

                          <small id='Z6HxA'></small><noframes id='Z6HxA'>

                          • <bdo id='Z6HxA'></bdo><ul id='Z6HxA'></ul>