This commit is contained in:
2025-06-22 15:27:26 +03:00
parent a64ed080bb
commit 2ab819ff30
11 changed files with 650 additions and 13 deletions

19
kernel/helpers/Url.php Normal file
View File

@ -0,0 +1,19 @@
<?php
namespace kernel\helpers;
class Url
{
public static function get_base_url()
{
// Удаляем параметр page если он есть
$currentUrl = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http")
. "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
// Удаляем параметр page если он есть
$currentUrl = preg_replace('/([?&])page=[^&]*(&|$)/', '$1', $currentUrl);
return rtrim($currentUrl, '?&');
}
}