kernel update

This commit is contained in:
2024-11-20 12:56:15 +03:00
parent 1ea3eca919
commit fd9439c9e2
32 changed files with 405 additions and 114 deletions

View File

@ -2,15 +2,24 @@
namespace kernel\widgets;
use kernel\helpers\Debug;
use kernel\Widget;
class ActionButtonWidget extends Widget
{
public function run(): void
public static function create(array $data = []): ActionButtonWidget
{
$icon = $this->data['icon'];
$btn = $this->data['btn'];
return new static($data);
}
public function run(): string
{
$label = $this->data['label'];
$btn_type = $this->data['btn_type'];
$url = $this->data['url'];
$this->cgView->render('/admin/action_button.php', ['icon' => $icon, 'btn' => $btn, 'url' => $url]);
$title = $this->data['title'] ?? '';
return $this->cgView->fetch('/action_button.php', ['label' => $label, 'btn_type' => $btn_type, 'url' => $url, 'title' => $title]);
}
}