src/Url.php
public function get($scheme = self::REL)
    {
        $data = $this->data;
        if ($scheme == self::REL) {
            unset($data['scheme'], $data['host'], $data['user'], $data['pass'], $data['port']);
            return $this->build($data);
        }
        if (!isset($data['host'])) {
            $data['host'] = $this->request->getHost();
        }
        if (!isset($data['scheme'])) {
            $scheme = self::SHORT_ABS;
        }

        if ($scheme == self::SHORT_ABS) {
            unset($data['scheme']);
            $url = $this->build($data, '//');
        } else {
            $url = $this->build($data);
        }

        return $this->asProtect($url, $data['host']);
    }
public function get($scheme = self::REL)
    {
        $data = $this->data;
        if ($scheme == self::REL) {
            unset($data['scheme'], $data['host'], $data['user'], $data['pass'], $data['port']);
            return $this->build($data);
        }
        if (!isset($data['host'])) {
            $data['host'] = $this->request->getHost();
        }
        if (!isset($data['scheme'])) {
            $scheme = self::SHORT_ABS;
        }

        if ($scheme == self::SHORT_ABS) {
            unset($data['scheme']);
            $url = $this->build($data, '//');
        } else {
            $url = $this->build($data);
        }

        return $this->asProtect($url, $data['host']);
    }
public function get ( $ scheme = self :: REL ) { $ data = $ this -> data ; if ( $ scheme == self :: REL ) { unset ( $ data [ 'scheme' ] , $ data [ 'host' ] , $ data [ 'user' ] , $ data [ 'pass' ] , $ data [ 'port' ] ) ; return $ this -> build ( $ data ) ; } if ( ! isset ( $ data [ 'host' ] ) ) { $ data [ 'host' ] = $ this -> request -> getHost ( ) ; } if ( ! isset ( $ data [ 'scheme' ] ) ) { $ scheme = self :: SHORT_ABS ; } if ( $ scheme == self :: SHORT_ABS ) { unset ( $ data [ 'scheme' ] ) ; $ url = $ this -> build ( $ data , '//' ) ; } else { $ url = $ this -> build ( $ data ) ; } return $ this -> asProtect ( $ url , $ data [ 'host' ] ) ; }
Returns formatted URL.
@param string $scheme
@return null|string
Returns formatted URL .