trafficmonitor/app/Helpers/TrafficHelper.php
2025-11-13 16:03:47 +09:00

37 lines
1.1 KiB
PHP

<?php
namespace App\Helpers;
use App\Entities\TrafficEntity;
class TrafficHelper extends CommonHelper
{
public function __construct()
{
parent::__construct();
}
public function getListButton(string $action, string $label, array $viewDatas, array $extras = []): string
{
switch ($action) {
case 'dashboard':
$action = form_label(
$label,
$action,
[
"data-src" => current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK() . '?' . $viewDatas['uri']->getQuery(),
"data-bs-toggle" => "modal",
"data-bs-target" => "#modal_action_form",
"class" => "btn btn-sm btn-primary form-label-sm",
...$extras
]
);
break;
default:
$action = parent::getListButton($action, $label, $viewDatas, $extras);
break;
}
return $action;
}
}