crud menu

This commit is contained in:
2024-08-30 16:14:31 +03:00
parent 5b4676a4c0
commit c325b156bd
28 changed files with 442 additions and 132 deletions

View File

@ -0,0 +1,17 @@
<?php
namespace app\tables\columns\menu;
use Itguild\Tables\ActionColumn\ActionColumn;
class MenuDeleteActionColumn 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> ";
}
}

View File

@ -0,0 +1,17 @@
<?php
namespace app\tables\columns\menu;
use Itguild\Tables\ActionColumn\ActionColumn;
class MenuEditActionColumn 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> ";
}
}

View File

@ -0,0 +1,17 @@
<?php
namespace app\tables\columns\menu;
use Itguild\Tables\ActionColumn\ActionColumn;
class MenuViewActionColumn extends ActionColumn
{
protected string $prefix = "/";
public function fetch(): string
{
$link = $this->baseUrl . $this->prefix . $this->id;
return " <a href='$link' class='btn btn-primary'>Просмотр</a> ";
}
}

View File

@ -1,6 +1,6 @@
<?php
namespace app\tables\columns;
namespace app\tables\columns\post;
use Itguild\Tables\ActionColumn\ActionColumn;

View File

@ -1,6 +1,6 @@
<?php
namespace app\tables\columns;
namespace app\tables\columns\post;
use Itguild\Tables\ActionColumn\ActionColumn;

View File

@ -1,6 +1,6 @@
<?php
namespace app\tables\columns;
namespace app\tables\columns\post;
use Itguild\Tables\ActionColumn\ActionColumn;

View File

@ -1,8 +1,7 @@
<?php
namespace app\tables\columns;
namespace app\tables\columns\user;
use app\helpers\Debug;
use Itguild\Tables\ActionColumn\ActionColumn;
class UserDeleteActionColumn extends ActionColumn

View File

@ -1,6 +1,6 @@
<?php
namespace app\tables\columns;
namespace app\tables\columns\user;
use Itguild\Tables\ActionColumn\ActionColumn;
@ -10,7 +10,6 @@ class UserEditActionColumn extends ActionColumn
public function fetch(): string
{
// $link = $this->baseUrl . $this->prefix . $this->id . $this->prefix . "update";
$link = $this->baseUrl . $this->prefix . $this->id;
return " <a href='$link' class='btn btn-success'>Редактировать</a> ";
}

View File

@ -1,6 +1,6 @@
<?php
namespace app\tables\columns;
namespace app\tables\columns\user;
use Itguild\Tables\ActionColumn\ActionColumn;