iT邦幫忙

0

laravel套用datatable,欄位製作功能按鈕

  • 分享至 

  • twitterImage

https://ithelp.ithome.com.tw/upload/images/20210128/20132806or0vq9ZZZW.png
如上圖,我想製作編輯和刪除的按鈕並用那個圖片,但格式語法一直錯誤,想請問如何改比較好?麻煩了~謝謝!

render:function(data, type, row, meta) {
    return '<a href = "{{ route('customers.edit', $customer -> idad_customer)}}"><img src = "{{ asset('images/edit.gif')}}"></a>'
},
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

0
screenleon
iT邦新手 1 級 ‧ 2021-01-29 09:18:24

不知道你有沒有發現你的函式實際上都沒有執行,下次可以檢查一下語法錯誤是錯在哪裡

return "<a href=\"" + route('customers.edit', $customer->idad_customer) + "\"><img src=\"" + asset('images/edit.gif') + "\"></a>";

我要發表回答

立即登入回答