fix action btn widger

This commit is contained in:
Kavalar 2024-11-19 14:08:43 +03:00
parent 0f47f73dda
commit 7a90980772
2 changed files with 4 additions and 3 deletions

View File

@ -39,7 +39,7 @@ $table->addAction(function ($row, $url) use ($moduleService) {
]);
} else {
ActionButtonWidget::create([
return ActionButtonWidget::create([
'label' => "<i class='fa-regular fa-circle-check'></i>",
'url' => "$url/deactivate/?slug=$slug",
'btn_type' => "success"

View File

@ -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]);
}
}