亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

將 Laravel 與 database.net 集成 - 行中可見的 html 標簽

將 Laravel 與 database.net 集成 - 行中可見的 html 標簽

PHP
蕪湖不蕪 2023-04-21 09:56:57
我在我的項目中使用這個組件:yajra/laravel-datatables我有控制器:public function dataTable(Request $request)    {        if ($request->ajax()) {            return Datatables::of($this->model->all())                ->addIndexColumn()                ->editColumn('enable', function ($row) {                    if ($row->enable == 1)                        return '<span class="label font-weight-bold label-lg  label-light-success label-inline">aktywny</span>';                    else return '<span class="label font-weight-bold label-lg  label-light-danger label-inline">nieaktywny</span>';                })                ->editColumn('name', function ($row) {                    return Str::limit($row->name, 80, '...');                })                ->addColumn('action', function ($row) {                    $btn = '<a href="' . route('product.edit', ['id' => $row->id]) . '" class="removeItem"><i class="far fa-edit"></i></a> ';                    $btn .= '<a href="' . route('product.destroy', ['id' => $row->id]) . '" class="removeItem"><i class="removeItem far fa-trash-alt"></i></a> ';                    return $btn;                })                ->rawColumns(['action'])                ->make(true);        }    }和 html: <table class="table table-bordered data-table    ">                        <thead>                        <tr class="resources">                            <th>ID</th>                            <th>Nazwa produktu</th>                            <th>Status</th>                            <th width="100px" class="text-center">Akcja</th>                        </tr>                        </thead>                        <tbody class="data-table-center">                        </tbody>                    </table>                </div>                ]            });        });在狀態(啟用)列中,我看到此 html 而不是最終字符串。好像一個刀片會嚴重取代這樣的 html。我的結果:<span class="label font-weight-bold label-lg label-light-success label-inline">aktywny</span>預覽: https: //ibb.co/6tXdH65我該如何解決?
查看完整描述

目前暫無任何回答

  • 0 回答
  • 0 關注
  • 98 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號