41 lines
1.3 KiB
PHP
41 lines
1.3 KiB
PHP
<?php
|
|
/**
|
|
* @var int $page_number
|
|
* @var \kernel\CgView $view
|
|
*/
|
|
|
|
use Itguild\EloquentTable\EloquentDataProvider;
|
|
use Itguild\EloquentTable\ListEloquentTable;
|
|
use kernel\app_modules\tag\models\Tag;
|
|
use kernel\IGTabel\btn\PrimaryBtn;
|
|
use kernel\models\Menu;
|
|
use kernel\modules\menu\table\columns\MenuDeleteActionColumn;
|
|
use kernel\modules\menu\table\columns\MenuEditActionColumn;
|
|
use kernel\modules\menu\table\columns\MenuViewActionColumn;
|
|
|
|
$view->setTitle("Список существующих диалогов");
|
|
|
|
$table = new ListEloquentTable(new EloquentDataProvider(\app\modules\tgbot\models\Tgbot::class, [
|
|
'currentPage' => $page_number,
|
|
'perPage' => 8,
|
|
'params' => ["class" => "table table-bordered", "border" => "2"],
|
|
'baseUrl' => "/admin/tg-bot",
|
|
]));
|
|
|
|
$table->beforePrint(function () {
|
|
return PrimaryBtn::create("Создать", "/admin/tg-bot/create")->fetch();
|
|
});
|
|
|
|
$table->columns([
|
|
"status" => [
|
|
"value" => function ($cell) {
|
|
return \app\modules\tgbot\models\Tgbot::getStatus()[$cell];
|
|
}]
|
|
]);
|
|
|
|
|
|
$table->addAction(\kernel\IGTabel\action_column\ViewActionColumn::class);
|
|
$table->addAction(\kernel\IGTabel\action_column\DeleteActionColumn::class);
|
|
$table->addAction(\kernel\IGTabel\action_column\EditActionColumn::class);
|
|
$table->create();
|
|
$table->render(); |