我希望向表格发送一些HTML标签,例如
我使用editColumn将一些HTML代码添加到此列
与addColumn
合作,但不与editColumn
问题是我如何从控制器向表格发送HTML元素,上面的例子在我需要查看标签时没有显示HTML标签
public function CustomerTicketAjax(Request $request, $id){
$tickets = Customer::find($id);
return Datatables::of(CustomerTicket::with('user')->where('customer_id', $tickets->id))
->editColumn('status', function ($tickets) {
if ($tickets->status == 1) {
return '<span class="label bg-red" style="font-size: 21px;">open</span>';
} elseif ($tickets->status == 0) {
return '<span class="label bg-red" style="font-size: 21px;">close</span>';
};
})
->make(true);}
答案 0 :(得分:0)
使用它:
{{breadcrumbs}}
<div class="clearfix">
<section class="main-column">
<h1>{{t 'submit_a_request'}}{{#if parent}}
<span class="follow-up-hint">
{{follow_up}}
</span>
{{/if}}</h1>
<div class="form">
{{request_form}}
</div>
</section>