kernel update
This commit is contained in:
@ -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]);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user