From 7a90980772a9cbea0e277805827656f3c7871afb Mon Sep 17 00:00:00 2001 From: Kavalar Date: Tue, 19 Nov 2024 14:08:43 +0300 Subject: [PATCH] fix action btn widger --- kernel/views/module/index.php | 2 +- kernel/widgets/ActionButtonWidget.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel/views/module/index.php b/kernel/views/module/index.php index f396de1..f53961f 100644 --- a/kernel/views/module/index.php +++ b/kernel/views/module/index.php @@ -39,7 +39,7 @@ $table->addAction(function ($row, $url) use ($moduleService) { ]); } else { - ActionButtonWidget::create([ + return ActionButtonWidget::create([ 'label' => "", 'url' => "$url/deactivate/?slug=$slug", 'btn_type' => "success" diff --git a/kernel/widgets/ActionButtonWidget.php b/kernel/widgets/ActionButtonWidget.php index f60217f..5dc6ac1 100644 --- a/kernel/widgets/ActionButtonWidget.php +++ b/kernel/widgets/ActionButtonWidget.php @@ -6,11 +6,12 @@ use kernel\Widget; class ActionButtonWidget extends Widget { - public function run(): void + public function run(): string { $label = $this->data['label']; $btn_type = $this->data['btn_type']; $url = $this->data['url']; - $this->cgView->render('/action_button.php', ['label' => $label, 'btn_type' => $btn_type, 'url' => $url]); + + return $this->cgView->fetch('/action_button.php', ['label' => $label, 'btn_type' => $btn_type, 'url' => $url]); } } \ No newline at end of file