some fix
This commit is contained in:
@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace kernel\modules\option\table\columns;
|
||||
|
||||
use Itguild\Tables\ActionColumn\ActionColumn;
|
||||
|
||||
class OptionDeleteActionColumn extends ActionColumn
|
||||
{
|
||||
protected string $prefix = "/delete/";
|
||||
|
||||
public function fetch(): string
|
||||
{
|
||||
$link = $this->baseUrl . $this->prefix . $this->id;
|
||||
return " <a href='$link' class='btn btn-danger'>Удалить</a> ";
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace kernel\modules\option\table\columns;
|
||||
|
||||
use Itguild\Tables\ActionColumn\ActionColumn;
|
||||
|
||||
class OptionEditActionColumn extends ActionColumn
|
||||
{
|
||||
protected string $prefix = "/update/";
|
||||
|
||||
public function fetch(): string
|
||||
{
|
||||
$link = $this->baseUrl . $this->prefix . $this->id;
|
||||
return " <a href='$link' class='btn btn-success'>Редактировать</a> ";
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace kernel\modules\option\table\columns;
|
||||
|
||||
use Itguild\Tables\ActionColumn\ActionColumn;
|
||||
|
||||
class OptionViewActionColumn extends ActionColumn
|
||||
{
|
||||
|
||||
protected string $prefix = "/";
|
||||
|
||||
public function fetch()
|
||||
{
|
||||
$link = $this->baseUrl . $this->prefix . $this->id;
|
||||
return " <a href='$link' class='btn btn-primary'>Просмотр</a> ";
|
||||
}
|
||||
|
||||
}
|
@ -6,11 +6,11 @@
|
||||
|
||||
use Itguild\EloquentTable\EloquentDataProvider;
|
||||
use Itguild\EloquentTable\ListEloquentTable;
|
||||
use kernel\IGTabel\action_column\DeleteActionColumn;
|
||||
use kernel\IGTabel\action_column\EditActionColumn;
|
||||
use kernel\IGTabel\action_column\ViewActionColumn;
|
||||
use kernel\IGTabel\btn\PrimaryBtn;
|
||||
use kernel\modules\option\models\Option;
|
||||
use kernel\modules\option\table\columns\OptionDeleteActionColumn;
|
||||
use kernel\modules\option\table\columns\OptionEditActionColumn;
|
||||
use kernel\modules\option\table\columns\OptionViewActionColumn;
|
||||
|
||||
$table = new ListEloquentTable(new EloquentDataProvider(Option::class, [
|
||||
'current_page' => $page_number,
|
||||
@ -31,8 +31,8 @@ $table->columns([
|
||||
}]
|
||||
]);
|
||||
|
||||
$table->addAction(OptionViewActionColumn::class);
|
||||
$table->addAction(OptionEditActionColumn::class);
|
||||
$table->addAction(OptionDeleteActionColumn::class);
|
||||
$table->addAction(ViewActionColumn::class);
|
||||
$table->addAction(EditActionColumn::class);
|
||||
$table->addAction(DeleteActionColumn::class);
|
||||
$table->create();
|
||||
$table->render();
|
Reference in New Issue
Block a user