0
環境:Laravel 5.4,Acacha\Adminlte,Yajra/laravel-datatables顯示在數據表只是HTML文本代碼(Laravel 5.4)
HTML代碼DataTable中的Laravel 5.4,而不是在分析網頁代碼,在Laravel 5.3 *好的工作。在網頁的問題
代碼片段
public function data()
{
DB::statement(DB::raw('set @rownum=0'));
$result = My_Model::select(array(
DB::raw('@rownum := @rownum + 1 AS rownum'),
'created_at',
'name'));
$datatables = Datatables::of($result)
->edit_Column('rownum', '<div style="text-align:center;"><a class="btn btn-primary btn-xs">{{ $rownum }}</a></div>')
->edit_Column('created_at','<div style="text-align:center;">{{ App\Functions::setDateTime($created_at) }}')
->edit_Column('name', '<div style="text-align:left;"><a class="btn btn-success btn-xs">{{ $name}}</a></div>');
return $datatables->make(true);
}
結果顯示在數據表中,只是這段文字,不應與值1按鈕:
<div style="text-align:center;"><a class="btn btn-primary btn-xs">1</a></div>
系統細節
Operating System: Windows 7 Professional
PHP Version: 7.0.10 (from Laragon 2.2.2)
Laravel Version: 5.4.11
Laravel-Datatables Version: 7.1.4 & 7.2.1