Lime\App::getSiteUrl PHP Method

getSiteUrl() public method

Get site url
public getSiteUrl ( $withpath = false ) : String
return String
    public function getSiteUrl($withpath = false)
    {
        $url = ($this->req_is("ssl") ? 'https' : 'http') . "://";
        if ($this->registry['base_port'] != "80") {
            $url .= $this->registry['base_host'] . ":" . $this->registry['base_port'];
        } else {
            $url .= $this->registry['base_host'];
        }
        if ($withpath) {
            $url .= implode("/", array_slice(explode("/", $_SERVER['SCRIPT_NAME']), 0, -1));
        }
        return rtrim($url, '/');
    }