public function makeUrl($path, $domain = false) {
        if (!$path) {
            $path = $this->getPath();
        }

        // Check for a specific scheme.
        $scheme = $this->getScheme();
        if ($domain === 'http' || $domain === 'https') {
            $scheme = $domain;
            $domain = true;
        }

        if ($domain === true) {
            $prefix = $scheme.'://'.$this->getHostAndPort().$this->getRoot();
        } elseif ($domain === false) {
            $prefix = $this->getRoot();
        } elseif ($domain === '//') {
            $prefix = '//'.$this->getHostAndPort().$this->getRoot();
        } else {
            $prefix = '';
        }

        return $prefix.'/'.ltrim($path, '/');
    }
public function makeUrl($path, $domain = false) {
        if (!$path) {
            $path = $this->getPath();
        }

        // Check for a specific scheme.
        $scheme = $this->getScheme();
        if ($domain === 'http' || $domain === 'https') {
            $scheme = $domain;
            $domain = true;
        }

        if ($domain === true) {
            $prefix = $scheme.'://'.$this->getHostAndPort().$this->getRoot();
        } elseif ($domain === false) {
            $prefix = $this->getRoot();
        } elseif ($domain === '//') {
            $prefix = '//'.$this->getHostAndPort().$this->getRoot();
        } else {
            $prefix = '';
        }

        return $prefix.'/'.ltrim($path, '/');
    }
public function makeUrl ( $ path , $ domain = false ) { if ( ! $ path ) { $ path = $ this -> getPath ( ) ; } // Check for a specific scheme. $ scheme = $ this -> getScheme ( ) ; if ( $ domain === 'http' || $ domain === 'https' ) { $ scheme = $ domain ; $ domain = true ; } if ( $ domain === true ) { $ prefix = $ scheme . '://' . $ this -> getHostAndPort ( ) . $ this -> getRoot ( ) ; } elseif ( $ domain === false ) { $ prefix = $ this -> getRoot ( ) ; } elseif ( $ domain === '//' ) { $ prefix = '//' . $ this -> getHostAndPort ( ) . $ this -> getRoot ( ) ; } else { $ prefix = '' ; } return $ prefix . '/' . ltrim ( $ path , '/' ) ; }
Construct a url on the current site.

@param string $path The path of the url.
@param mixed $domain Whether or not to include the domain. This can be one of the following.
- false: The domain will not be included.
- true: The domain will be included.
- http: Force http.
- https: Force https.
- //: A schemeless domain will be included.
- /: Just the path will be returned.
@return string Returns the url.
Construct a url on the current site .