option CRUD
This commit is contained in:
23
kernel/modules/option/views/view.php
Normal file
23
kernel/modules/option/views/view.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \Illuminate\Database\Eloquent\Collection $option
|
||||
*/
|
||||
|
||||
use Itguild\EloquentTable\ViewEloquentTable;
|
||||
use Itguild\EloquentTable\ViewJsonTableEloquentModel;
|
||||
use kernel\IGTabel\btn\DangerBtn;
|
||||
use kernel\IGTabel\btn\PrimaryBtn;
|
||||
use kernel\IGTabel\btn\SuccessBtn;
|
||||
|
||||
$table = new ViewEloquentTable(new ViewJsonTableEloquentModel($option, [
|
||||
'params' => ["class" => "table table-bordered", "border" => "2"],
|
||||
'baseUrl' => "/admin/user",
|
||||
]));
|
||||
$table->beforePrint(function () use ($option) {
|
||||
$btn = PrimaryBtn::create("Список", "/admin/option")->fetch();
|
||||
$btn .= SuccessBtn::create("Редактировать", "/admin/option/update/" . $option->id)->fetch();
|
||||
$btn .= DangerBtn::create("Удалить", "/admin/option/delete/" . $option->id)->fetch();
|
||||
return $btn;
|
||||
});
|
||||
$table->create();
|
||||
$table->render();
|
Reference in New Issue
Block a user