简体   繁体   English

Laravel 5.7:Laravel集体表转html表

[英]Laravel 5.7: Laravel Collective Form to html form

I have the following laravel collective form code我有以下 laravel 集体表格代码

{!! Form::open(['action' => ['CategoryController@sub8', $item1->id], 'method' => 'post']) !!}
{{Form::label('postaladdress', 'Postal Address')}}
{{Form::text('postaladdress',null, array('class' => 'form-control'))}}
{{ Form::hidden('_method', 'PUT') }}

{{ Form::submit('Change Postal Address') }}
{!! Form::close() !!}

How can i get this in normal html form?我怎样才能以正常的 html 形式获得它?

You should be able to figure this out based on what the HTML tags would be but to save yourself time here you go, this is roughly what that is:您应该能够根据 HTML 标签的内容来弄清楚这一点,但为了节省您自己的时间,您 go大致如下:

<form method="POST" action="{{ action('CategoryController@sub8', [$item1->id]) }}">
    <input type="hidden" name="_method" value="PUT">
    <label for="postaladdress">Postal Address</label>
    <textarea name="postaladdress" class="form-control"></textarea>
    <input type="submit" value="Change your address">
    <input type="hidden" name="_token" value="{{ csrf_token() }}">
</form>

I forget if Laravel Collective - HTML will add the CSRF token for you or not, but i added it anyway in the example above.我忘记了 Laravel Collective - HTML 是否会为您添加 CSRF 令牌,但我还是在上面的示例中添加了它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM