diff --git a/config/config.php b/config/config.php index 4fe5c5b..0971b05 100644 --- a/config/config.php +++ b/config/config.php @@ -28,11 +28,13 @@ $_ENV['APP_URL'] = APP_URL; * url('ressources/user/login.php') * url('api/items', ['page'=>2]) */ -function url(string $path = '', array $qs = []): string -{ - $u = APP_URL . ltrim($path, '/'); - if ($qs) { - $u .= (str_contains($u, '?') ? '&' : '?') . http_build_query($qs); +if (!function_exists('url')) { + function url(string $path = '', array $qs = []): string + { + $u = APP_URL . ltrim($path, '/'); + if ($qs) { + $u .= (str_contains($u, '?') ? '&' : '?') . http_build_query($qs); + } + return $u; } - return $u; }