kernel update

This commit is contained in:
2024-12-16 14:26:13 +03:00
parent 589cf81e49
commit f5ad07c04a
77 changed files with 2067 additions and 251 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]);
}
}