Laravel-datatables: Render html on setRowData

Created on 27 May 2020  路  1Comment  路  Source: yajra/laravel-datatables

Summary of problem or feature request


Hi,
Is there any possibility to send html in setRowData? Something like this:

Code snippet of problem

 ->setRowData([
           'contact' => function ($contact) {
                 return "<li>$contact->name</li>";
            },               
     ])

System details

  • Operating System: Win10
  • PHP Version: 7.4.5
  • Laravel Version: 6.4
  • Laravel-Datatables Version: 9.0
question

Most helpful comment

Not sure but maybe try using HtmlString.

 ->setRowData([
           'contact' => function ($contact) {
                 return new HtmlString("<li>$contact->name</li>");
            },               
     ])

>All comments

Not sure but maybe try using HtmlString.

 ->setRowData([
           'contact' => function ($contact) {
                 return new HtmlString("<li>$contact->name</li>");
            },               
     ])
Was this page helpful?
0 / 5 - 0 ratings