PHP Класс Ergo\Http\Url

См. также: http://github.com/pda/phool
Автор: Paul Annesley ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( string $urlString )
__toString ( ) : string The URL as a string.
construct ( $urlString )
getDefaultPort ( ) : integer The default TCP port for the scheme of the URL
getFragmentString ( ) : string Fragment string (after fragment delimiter '#')
getHost ( ) : string Hostname (without port information) e.g. example.org
getHostRelativeUrl ( ) : string The URL components after the host.
getHostWithPort ( ) : string Host, including port unless it is the default port for the scheme.
getPath ( ) : string Path component (after host, before query string delimiter '?')
getPort ( ) : integer TCP port number, defaults to 80 for HTTP and 443 for HTTPS.
getQueryString ( ) : string Query string (after query delimiter '?', before fragment delimiter '#')
getScheme ( ) : string Scheme, either http or https
getSchemeRelativeUrl ( ) : string The URL components after the scheme
getUrlForFragment ( $fragment ) : Url Builds a url with a different fragment (the part after # in the url)
getUrlForHost ( $host ) : Url Builds a URL with a different host
getUrlForMergedParameters ( array $queryParameters ) Builds a URL with added/merged query parameters
getUrlForParameters ( array $queryParameters )
getUrlForPath ( $path ) : Url Builds a URL with a different path component
getUrlForRelativePath ( $path ) : Url Builds a URL with a path component that is relative to the current one
getUrlForScheme ( $scheme ) : Url Builds a URL with a different scheme
hasDefaultPort ( ) Whether the URL has a default port (i.e. has a scheme)
hasFragmentString ( ) : boolean Whether the URL has a fragment string.
hasHost ( ) : boolean Whether the URL has a host component.
hasPort ( ) Whether the URL has an explicitly specified port.
hasQueryString ( ) : boolean Whether the URL has a query string.
hasScheme ( ) : boolean Whether the URL has a scheme component.
isPortDefault ( ) : boolean Whether the port is the default for the scheme.
relative ( $path )

Приватные методы

Метод Описание
_joinPathComponents ( $path ) Join path/querystring/fragment components together

Описание методов

__construct() публичный Метод

public __construct ( string $urlString )
$urlString string

__toString() публичный Метод

The URL as a string.
public __toString ( ) : string
Результат string

construct() публичный статический Метод

public static construct ( $urlString )

getDefaultPort() публичный Метод

The default TCP port for the scheme of the URL
public getDefaultPort ( ) : integer
Результат integer or null

getFragmentString() публичный Метод

Fragment string (after fragment delimiter '#')
public getFragmentString ( ) : string
Результат string

getHost() публичный Метод

Hostname (without port information) e.g. example.org
public getHost ( ) : string
Результат string

getHostRelativeUrl() публичный Метод

The URL components after the host.
public getHostRelativeUrl ( ) : string
Результат string

getHostWithPort() публичный Метод

Host, including port unless it is the default port for the scheme.
public getHostWithPort ( ) : string
Результат string

getPath() публичный Метод

Path component (after host, before query string delimiter '?')
public getPath ( ) : string
Результат string

getPort() публичный Метод

TCP port number, defaults to 80 for HTTP and 443 for HTTPS.
public getPort ( ) : integer
Результат integer

getQueryString() публичный Метод

Query string (after query delimiter '?', before fragment delimiter '#')
public getQueryString ( ) : string
Результат string

getScheme() публичный Метод

Scheme, either http or https
public getScheme ( ) : string
Результат string

getSchemeRelativeUrl() публичный Метод

The URL components after the scheme
public getSchemeRelativeUrl ( ) : string
Результат string

getUrlForFragment() публичный Метод

Builds a url with a different fragment (the part after # in the url)
public getUrlForFragment ( $fragment ) : Url
Результат Url

getUrlForHost() публичный Метод

Builds a URL with a different host
public getUrlForHost ( $host ) : Url
Результат Url

getUrlForMergedParameters() публичный Метод

Builds a URL with added/merged query parameters
public getUrlForMergedParameters ( array $queryParameters )
$queryParameters array

getUrlForParameters() публичный Метод

public getUrlForParameters ( array $queryParameters )
$queryParameters array

getUrlForPath() публичный Метод

Builds a URL with a different path component
public getUrlForPath ( $path ) : Url
Результат Url

getUrlForRelativePath() публичный Метод

Builds a URL with a path component that is relative to the current one
public getUrlForRelativePath ( $path ) : Url
Результат Url

getUrlForScheme() публичный Метод

Builds a URL with a different scheme
public getUrlForScheme ( $scheme ) : Url
Результат Url

hasDefaultPort() публичный Метод

Whether the URL has a default port (i.e. has a scheme)
public hasDefaultPort ( )

hasFragmentString() публичный Метод

Whether the URL has a fragment string.
public hasFragmentString ( ) : boolean
Результат boolean

hasHost() публичный Метод

Whether the URL has a host component.
public hasHost ( ) : boolean
Результат boolean

hasPort() публичный Метод

Whether the URL has an explicitly specified port.
public hasPort ( )

hasQueryString() публичный Метод

Whether the URL has a query string.
public hasQueryString ( ) : boolean
Результат boolean

hasScheme() публичный Метод

Whether the URL has a scheme component.
public hasScheme ( ) : boolean
Результат boolean

isPortDefault() публичный Метод

Whether the port is the default for the scheme.
public isPortDefault ( ) : boolean
Результат boolean

relative() публичный Метод

public relative ( $path )