src/UrlBuilder.php
public function getBaseUrl()
    {
        $url = '';
        if (isset($this->scheme)) {
            if ('' !== $this->scheme) {
                $url .= $this->scheme . ':';
            }
            $url .= '//';
        }

        if (isset($this->user)) {
            $url .= $this->user;

            if (isset($this->pass)) {
                $url .= ':' . $this->pass;
            }

            $url .= '@';
        }

        $url .= $this->host;

        if (isset($this->port)) {
            $url .= ':' . $this->port;
        }

        if (isset($this->path)) {
            if ($url != '' && $this->path[0] !== '/') {
                $url .= '/';
            }

            $url .= $this->path;
        }

        return $url;
    }
public function getBaseUrl()
    {
        $url = '';
        if (isset($this->scheme)) {
            if ('' !== $this->scheme) {
                $url .= $this->scheme . ':';
            }
            $url .= '//';
        }

        if (isset($this->user)) {
            $url .= $this->user;

            if (isset($this->pass)) {
                $url .= ':' . $this->pass;
            }

            $url .= '@';
        }

        $url .= $this->host;

        if (isset($this->port)) {
            $url .= ':' . $this->port;
        }

        if (isset($this->path)) {
            if ($url != '' && $this->path[0] !== '/') {
                $url .= '/';
            }

            $url .= $this->path;
        }

        return $url;
    }
public function getBaseUrl ( ) { $ url = '' ; if ( isset ( $ this -> scheme ) ) { if ( '' !== $ this -> scheme ) { $ url .= $ this -> scheme . ':' ; } $ url .= '//' ; } if ( isset ( $ this -> user ) ) { $ url .= $ this -> user ; if ( isset ( $ this -> pass ) ) { $ url .= ':' . $ this -> pass ; } $ url .= '@' ; } $ url .= $ this -> host ; if ( isset ( $ this -> port ) ) { $ url .= ':' . $ this -> port ; } if ( isset ( $ this -> path ) ) { if ( $ url != '' && $ this -> path [ 0 ] !== '/' ) { $ url .= '/' ; } $ url .= $ this -> path ; } return $ url ; }
Retrieve the base url.

The base URL is the url without query part and fragment.

@return string|null
Retrieve the base url .