From fbbba84cc86152fb143fee3bc5522b174a1da368 Mon Sep 17 00:00:00 2001 From: Juan Cristobal <65052633+juancristobalgd1@users.noreply.github.com> Date: Tue, 26 Dec 2023 20:28:02 +0100 Subject: [PATCH] function --- src/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/functions.php b/src/functions.php index 146933a..485aff2 100644 --- a/src/functions.php +++ b/src/functions.php @@ -968,13 +968,13 @@ function class_basename($class) * @param bool $secure Force the use of HTTPS in the URL * @return string Full URL of the resource. */ - function asset($path, $basePath = null) + function asset(string $path, $basePath = null): string { // Get the URL base of your application from the configuration or as you prefer. $baseUrl = $basePath ? $basePath : ''; // Combines the base URL with the relative path of the resource. - $url = rtrim($baseUrl, '/') . '/' . ltrim($path, '/'); + $url = rtrim($baseUrl, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . ltrim($path, DIRECTORY_SEPARATOR); $fullUrl = baseUrl($url); return $fullUrl;