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