我在我的LARAVEL项目中使用了这个代码https://codepen.io/saper639/details/YzzJpBv.
但在html中使用以下代码:
<script type="text/html">
<tr data-index="$index">
<td>{{index+1}}</td>
<td>{{id}}</td>
<td class='edit' data-type='textbox' data-field='firstname'>{{firstname}}</td>
<td class='edit' data-type='textbox' data-field='lastname'>{{lastname}}</td>
<td class='edit' data-type='dropdown' data-field='color_id' data-source='arr_colors'>{{color_id|select(arr_colors)}}</td>
<td><button type='button' class='btn btn-danger btn-flat btn-xs' data-bind="rem__click:remRow" data-id='$index' title='Удалить запись'><i class='fa fa-fw fa-remove'></i></button></td>
</tr>
</script>
在laravel中添加此代码后,显示以下错误:
Use of undefined constant index - assumed 'index' (this will throw an Error in a future version of PHP)
如何发出此错误?