Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 数据表中的呈现复选框_Php_Laravel_Datatables - Fatal编程技术网

Php 数据表中的呈现复选框

Php 数据表中的呈现复选框,php,laravel,datatables,Php,Laravel,Datatables,我有这张桌子 <table class="table is-fullwidth" id="users-table"> <thead> <tr> <th> </th> <th> ID </th> <th> FIRST NAME </th>

我有这张桌子

    <table class="table is-fullwidth" id="users-table">
        <thead>
            <tr>
                <th> </th>
                <th> ID </th>
                <th> FIRST NAME </th>
                <th> LAST NAME </th>
                <th> EMAIL </th>
                <th> ROLE </th>
            </tr>
        </thead>
        <tfoot>
            <tr>
                <th> </th>
                <th> ID </th>
                <th> FIRST NAME </th>
                <th> LAST NAME </th>
                <th> EMAIL </th>
                <th> ROLE </th>
            </tr>
        </tfoot>
    </table>
对于
data table\checkbox.blade.php
内容如下:

<input type="checkbox" name="" value="">

这是基于在这里找到的文档 这里有一些例子

但当我看输出时,这就是结果。


我打印复选框html代码,我的问题是如何将其呈现为复选框?

您可以尝试
{!!''!!}
而不是
{{'}

因为您使用的是select扩展,并且复选框应该与之一起工作,所以您真的不需要自己提供复选框

只需将
className:“选择复选框”
添加到第一列,即

$(“#用户表”).DataTable({
处理:对,
服务器端:是的,
ajax:“系统用户/数据”,
columnDefs:[{
可订购:错误,
目标:0,

className:“选择复选框”//似乎laravel正在为单元格转义html特殊字符/column@Fil.you可以使用原始列
public function anyData()
{
    $users = UserRole::selectRaw('users.id, users.first_name, users.last_name, users.email, roles.role')
        ->join('users', 'users.id', '=', 'user_roles.user_id')
        ->join('roles', 'roles.id', '=', 'user_roles.role_id');

    return Datatables::of($users)
        ->addColumn('select', 'systemusers::data-table.checkbox')
        ->make(true);
}
<input type="checkbox" name="" value="">