first table

This commit is contained in:
kali
2024-05-27 12:11:56 +03:00
commit 3f6e5ffcec
11 changed files with 486 additions and 0 deletions

View File

@ -0,0 +1,20 @@
<?php
namespace itguild\forms\table\ActionColumn;
abstract class ActionColumn
{
protected string $baseUrl;
protected string $prefix;
protected int $id;
public function __construct(string $baseUrl, int $id)
{
$this->baseUrl = $baseUrl;
$this->id = $id;
}
abstract public function fetch();
}

View File

@ -0,0 +1,14 @@
<?php
namespace itguild\forms\table\ActionColumn;
class DeleteActionColumn extends ActionColumn
{
protected string $prefix = "/form-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,16 @@
<?php
namespace itguild\forms\table\ActionColumn;
class EditActionColumn extends ActionColumn
{
protected string $prefix = "/form-edit/";
public function fetch(): string
{
$link = $this->baseUrl . $this->prefix . $this->id;
return " <a href='$link' class='btn btn-primary'>Редактировать</a> ";
}
}

View File

@ -0,0 +1,14 @@
<?php
namespace itguild\forms\table\ActionColumn;
class ViewActionColumn extends ActionColumn
{
protected string $prefix = "/form-item/";
public function fetch(): string
{
$link = $this->baseUrl . $this->prefix . $this->id;
return " <a href='$link' class='btn btn-primary'>Просмотр</a> ";
}
}