MicroFrameWork/kernel/widgets/ActionButtonWidget.php

25 lines
593 B
PHP
Raw Permalink Normal View History

2024-11-19 11:21:46 +03:00
<?php
namespace kernel\widgets;
2024-11-19 14:55:25 +03:00
use kernel\helpers\Debug;
2024-11-19 11:21:46 +03:00
use kernel\Widget;
class ActionButtonWidget extends Widget
{
2024-11-19 14:55:25 +03:00
public static function create(array $data = []): ActionButtonWidget
{
return new static($data);
}
2024-11-19 14:08:43 +03:00
public function run(): string
2024-11-19 11:21:46 +03:00
{
2024-11-19 13:41:13 +03:00
$label = $this->data['label'];
$btn_type = $this->data['btn_type'];
2024-11-19 11:21:46 +03:00
$url = $this->data['url'];
2024-11-20 12:45:02 +03:00
$title = $this->data['title'] ?? '';
2024-11-19 14:08:43 +03:00
2024-11-20 12:45:02 +03:00
return $this->cgView->fetch('/action_button.php', ['label' => $label, 'btn_type' => $btn_type, 'url' => $url, 'title' => $title]);
2024-11-19 11:21:46 +03:00
}
}