src/includes/classes/Core/Utils/Url.php
public function toApi(string $uri = '', string $scheme = ''): string
    {
        if (!($host = $this->App->Config->©urls['©hosts']['©api'])) {
            throw $this->c::issue('API host is empty.');
        }
        $uri = $uri ? $this->c::mbLTrim($uri, '/') : '';
        $uri = $uri ? '/'.$uri : ''; // Force leading slash.

        $base_path = $this->App->Config->©urls['©base_paths']['©api'];
        $base_path = $base_path && $uri ? $this->c::mbRTrim($base_path, '/') : $base_path;

        $url = $this->c::setScheme('//'.$host.$base_path.$uri, $scheme);

        return $url;
    }
public function toApi(string $uri = '', string $scheme = ''): string
    {
        if (!($host = $this->App->Config->©urls['©hosts']['©api'])) {
            throw $this->c::issue('API host is empty.');
        }
        $uri = $uri ? $this->c::mbLTrim($uri, '/') : '';
        $uri = $uri ? '/'.$uri : ''; // Force leading slash.

        $base_path = $this->App->Config->©urls['©base_paths']['©api'];
        $base_path = $base_path && $uri ? $this->c::mbRTrim($base_path, '/') : $base_path;

        $url = $this->c::setScheme('//'.$host.$base_path.$uri, $scheme);

        return $url;
    }
Build API URL.

@since 17xxxx URL utilities.

@param string $uri    URI to append.
@param string $scheme Specific scheme?

@return string Output URL.