index template

This commit is contained in:
2024-12-12 12:41:45 +03:00
parent 1e566481f7
commit f7253bafe9
9 changed files with 32 additions and 190 deletions

View File

@ -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();