protected function setUrlScheme($url, $scheme = '')
    {
        if (!($url = (string) $url)) {
            return $url; // Nothing to do.
        }
        $scheme = (string) $scheme;

        if (!$scheme) {
            $scheme = $this->currentUrlScheme();
        }
        if ($scheme !== '//') {
            $scheme = $this->nUrlScheme($scheme).'://';
        }
        return preg_replace('/^(?:[a-z0-9]+\:)?\/\//ui', $this->escRefs($scheme), $url);
    }
protected function setUrlScheme($url, $scheme = '')
    {
        if (!($url = (string) $url)) {
            return $url; // Nothing to do.
        }
        $scheme = (string) $scheme;

        if (!$scheme) {
            $scheme = $this->currentUrlScheme();
        }
        if ($scheme !== '//') {
            $scheme = $this->nUrlScheme($scheme).'://';
        }
        return preg_replace('/^(?:[a-z0-9]+\:)?\/\//ui', $this->escRefs($scheme), $url);
    }
protected function setUrlScheme ( $ url , $ scheme = '' ) { if ( ! ( $ url = ( string ) $ url ) ) { return $ url ; // Nothing to do. } $ scheme = ( string ) $ scheme ; if ( ! $ scheme ) { $ scheme = $ this -> currentUrlScheme ( ) ; } if ( $ scheme !== '//' ) { $ scheme = $ this -> nUrlScheme ( $ scheme ) . '://' ; } return preg_replace ( '/^(?:[a-z0-9]+\:)?\/\//ui' , $ this -> escRefs ( $ scheme ) , $ url ) ; }
Sets a particular scheme.

@since 140417 Initial release.

@param string $url    A full URL.
@param string $scheme Optional. The scheme to use (i.e. `//`, `https`, `http`).
Use `//` to use a cross-protocol compatible scheme.
Defaults to the current scheme.

@return string The full URL w/ `$scheme`.
Sets a particular scheme .