public function init()
    {
        $this->requestUri = $this->getServer('REQUEST_URI');
        $scriptName = $this->getServer('SCRIPT_NAME');
        $this->path = rtrim(dirname($scriptName), '/');
        $this->scriptName = basename($scriptName);

        // The route and its parts
        $this->extractRoute();

        // Prepare to create siteUrl and baseUrl by using currentUrl
        $this->currentUrl = $this->getCurrentUrl();
        $parts = parse_url($this->currentUrl);
        $this->siteUrl = "{$parts['scheme']}://{$parts['host']}"
            . (isset($parts['port'])
                ? ":{$parts['port']}"
                : '');
        $this->baseUrl = $this->siteUrl . $this->path;

        return $this;
    }