public function getBaseUrl(bool $withHostName = false):string
    {
        if (!$this->baseUrl) {
            $this->baseUrl = dirname(filter_input(INPUT_SERVER, 'SCRIPT_NAME'));
        }
        return ($withHostName ? self::getHttpHost() : '') . $this->baseUrl;
    }