【问题标题】:Laravel 5.5 add form idLaravel 5.5 添加表单 ID
【发布时间】:2018-06-05 16:28:24
【问题描述】:

我有以下内容: {!! Form::model($houses, ['method' => 'PATCH','route' => ['houses.update', $houses->id]]) !!}

{!! Form::open(array('route' => 'houses.store','method'=>'POST')) !!}

女巫导致: <form method="POST" action="http://localhost/j/public_html/houses/2" accept-charset="UTF-8">

<form method="POST" action="http://localhost/j/public_html/houses" accept-charset="UTF-8">

如何在两者中添加<form id="houseform" ...

谢谢

【问题讨论】:

    标签: forms laravel-5 laravel-5.5 laravelcollective laravel-form


    【解决方案1】:

    你可以使用:

    {!! Form::model($houses, [
               'method' => 'PATCH',
               'route' => ['houses.update', $houses->id], 
               'id' => 'houseform'
       ]) !!}
    

    第二次类似:

    {!! Form::open(array('route' => 'houses.store','method'=>'POST', 'id' => 'houseform')) !!}
    

    【讨论】:

    • 谢谢@Marcin,我错误地尝试了{!! Form::model($houses, ['method' => 'PATCH','route' => ['houses.update', $houses->id]]), 'id' => 'houseform' !!}之类的东西,现在可以了!
    猜你喜欢
    • 2013-06-21
    • 1970-01-01
    • 2018-05-30
    • 2018-06-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-30
    • 2018-05-20
    相关资源
    最近更新 更多