1
我有幾個字段類型array
,我想通過使用Input::except()
來避免。我該怎麼做? HTML是如下:跳過Laravel 4中的多個輸入字段
<tr>
<td>
{{ Form::input('text', 'batch_name[]', null, ['placeholder' =>'Enter batch name']) }}
</td>
<td>
{{ Form::input('date', 'availability_date[]', null) }}
</td>
<td>
<a class="add" title="Add Row" href="#"><img src="{{URL::to('public/assets/images/plus.png')}}" alt=""/></a>
</td>
</tr>
以下不工作,給錯誤:
htmlentities() expects parameter 1 to be string, array given
Validator::make(Input::except('_token','batch_name[]','availability_date[]'), $rules);
嘗試'驗證::化妝(輸入::除了( '_令牌', 'batch_name', 'availability_date' ),$ rules);' - 它能正確工作嗎? – Laurence 2015-04-03 08:54:32
只是從'$ rules'中刪除'batch_name',那麼它將不會被驗證。 – NULL 2015-04-03 08:58:16
@TheShiftExchange不,它不是。 – Volatil3 2015-04-03 09:19:59