index template
This commit is contained in:
@ -13,12 +13,37 @@ use kernel\widgets\IconBtn\IconBtnDeleteWidget;
|
||||
use kernel\widgets\IconBtn\IconBtnEditWidget;
|
||||
use kernel\widgets\IconBtn\IconBtnViewWidget;
|
||||
|
||||
$table = new ListEloquentTable(new EloquentDataProvider({model}::class, [
|
||||
'currentPage' => $page_number,
|
||||
'perPage' => 8,
|
||||
'params' => ["class" => "table table-bordered", "border" => "2"],
|
||||
'baseUrl' => "/admin/{slug}"
|
||||
]));
|
||||
//Для использования таблицы с моделью, необходимо создать таблицу в базе данных
|
||||
//$table = new ListEloquentTable(new EloquentDataProvider({model}::class, [
|
||||
// 'currentPage' => $page_number,
|
||||
// 'perPage' => 8,
|
||||
// 'params' => ["class" => "table table-bordered", "border" => "2"],
|
||||
// 'baseUrl' => "/admin/{slug}"
|
||||
//]));
|
||||
|
||||
|
||||
$table = new \Itguild\Tables\ListJsonTable(json_encode(
|
||||
[
|
||||
'meta' => [
|
||||
'total' => 0,
|
||||
'totalWithFilters' => 0,
|
||||
'columns' => [
|
||||
'title',
|
||||
'slug',
|
||||
'status',
|
||||
],
|
||||
'perPage' => 5,
|
||||
'currentPage' => 1,
|
||||
'baseUrl' => '/admin/some',
|
||||
'params' => [
|
||||
'class' => 'table table-bordered',
|
||||
'border' => 2
|
||||
]
|
||||
],
|
||||
'filters' => [],
|
||||
'data' => [],
|
||||
]
|
||||
));
|
||||
|
||||
$table->beforePrint(function () {
|
||||
return IconBtnCreateWidget::create(['url' => '/admin/{slug}/create'])->run();
|
||||
|
Reference in New Issue
Block a user