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

22
actionBtn/ActionBtn.php Normal file
View File

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

13
actionBtn/ToDeleteBtn.php Normal file
View File

@ -0,0 +1,13 @@
<?php
namespace itguild\forms\table\actionBtn;
class ToDeleteBtn extends ActionBtn
{
protected string $prefix = "/form-delete/";
public function fetch(): string
{
return "<a class='btn btn-danger' href='$this->baseUrl$this->prefix$this->id' style='margin: 3px'>Удалить</a>";
}
}

13
actionBtn/ToEditBtn.php Normal file
View File

@ -0,0 +1,13 @@
<?php
namespace itguild\forms\table\actionBtn;
class ToEditBtn extends ActionBtn
{
protected string $prefix = "/form-edit/";
public function fetch(): string
{
return "<a class='btn btn-warning' href='$this->baseUrl$this->prefix$this->id' style='margin: 3px'>Редактировать</a>";
}
}

13
actionBtn/ToListBtn.php Normal file
View File

@ -0,0 +1,13 @@
<?php
namespace itguild\forms\table\actionBtn;
class ToListBtn extends ActionBtn
{
protected string $prefix = "/form-result/";
public function fetch(): string
{
return "<a class='btn btn-primary' href='$this->baseUrl$this->prefix$this->id' style='margin: 3px'>Список</a>";
}
}