virutmath/table-admin

后端列表记录

1.1.0 2019-09-11 08:11 UTC

This package is auto-updated.

Last update: 2024-09-26 20:42:02 UTC


README

  • 项目独立的TableAdmin
  • 使用Bootstrap样式,iCheckselect2
  • 支持表格分页

用法

$config = [
    'show' => [
        'id' => true
    ],
    'formatDate' => 'd/m/Y',
    'defaultOptionLabel' => '',
    'pageSize' => 30,
    'module'=>'',
    'idField'=>'id',
];
$categories = [
  1=>'Category 1',
  2=>'Category 2'
];
$listRecord = [
  [
    'id'=>1,
    'name'=>'Jame Doe',
    'category_id'=>1
    'active'=>1
  ],
  [
    'id'=>2,
    'name'=>'Joe Doe',
    'category_id'=>2
    'active'=>0
  ]
];

$table = new TableAdmin($listRecord,$config);
$table->column('id','ID record','text');
$table->columnDropdown('category_id','Category',$categories);
$table->column('active','Active','checkbox');
$table->column('id','Edit','edit');
$table->column('id','Delete','delete');
echo $table->render();