PHP Класс Horde_Url, horde

Автор: Jan Schneider ([email protected])
Автор: Michael Slusarz ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$anchor string The anchor string (a/k/a fragment).
$parameters array The keys are paramter names, the values parameter values. Array values will be added to the URL using name[]=value notation.
$pathInfo string Any PATH_INFO to be added to the URL.
$raw boolean Whether to output the URL in the raw URL format or HTML-encoded.
$toStringCallback callback A callback function to use when converting to a string.
$url string The basic URL, without query parameters.

Защищенные свойства (Protected)

Свойство Тип Описание
$_cache array Cached parameter list for use in toString().

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

Метод Описание
__construct ( string | Horde_Url $url = '', boolean $raw = null ) Constructor.
__toString ( ) : string Creates the full URL string.
add ( mixed $parameters, string $value = null ) : Horde_Url Adds one or more query parameters.
copy ( ) : Horde_Url Returns a clone of this object. Useful for chaining.
link ( array $attributes = [] ) : string Generates a HTML link tag out of this URL.
redirect ( ) Sends a redirect request to the browser to the URL in this object.
remove ( $parameters ) : Horde_Url Removes one ore more parameters.
setAnchor ( string $anchor ) : Horde_Url Sets the URL anchor.
setRaw ( boolean $raw ) : Horde_Url Sets the $raw value. This call can be chained.
setScheme ( string $scheme = 'http', boolean $replace = false ) : Horde_Url Sets the URL scheme.
toString ( boolean $raw = false, boolean $full = true ) : string Creates the full URL string.
unique ( ) : Horde_Url Add a unique parameter to the URL to aid in cache-busting.
uriB64Decode ( string $string ) : string Decode URL-safe base64 data, dealing with missing '='.
uriB64Encode ( string $string ) : string URL-safe base64 encoding, with trimmed '='.

Защищенные методы

Метод Описание
_getParameters ( ) : array Return a formatted list of URL parameters.

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

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

Constructor.
public __construct ( string | Horde_Url $url = '', boolean $raw = null )
$url string | Horde_Url The basic URL, with or without query parameters.
$raw boolean Whether to output the URL in the raw URL format or HTML-encoded.

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

Creates the full URL string.
public __toString ( ) : string
Результат string The string representation of this object.

_getParameters() защищенный Метод

Return a formatted list of URL parameters.
protected _getParameters ( ) : array
Результат array Parameter list.

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

Adds one or more query parameters.
public add ( mixed $parameters, string $value = null ) : Horde_Url
$parameters mixed Either the name value or an array of name/value pairs.
$value string If specified, the value part ($parameters is then assumed to just be the parameter name).
Результат Horde_Url This (modified) object, to allow chaining.

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

Returns a clone of this object. Useful for chaining.
public copy ( ) : Horde_Url
Результат Horde_Url A clone of this object.

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

Sends a redirect request to the browser to the URL in this object.
public redirect ( )

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

Removes one ore more parameters.
public remove ( $parameters ) : Horde_Url
Результат Horde_Url This (modified) object, to allow chaining.

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

Sets the URL anchor.
public setAnchor ( string $anchor ) : Horde_Url
$anchor string An anchor to add.
Результат Horde_Url This (modified) object, to allow chaining.

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

Sets the $raw value. This call can be chained.
public setRaw ( boolean $raw ) : Horde_Url
$raw boolean Whether to output the URL in the raw URL format or HTML-encoded.
Результат Horde_Url This object, to allow chaining.

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

Sets the URL scheme.
public setScheme ( string $scheme = 'http', boolean $replace = false ) : Horde_Url
$scheme string The URL scheme.
$replace boolean Force using $scheme, even if it already exists?
Результат Horde_Url This object, to allow chaining.

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

Creates the full URL string.
public toString ( boolean $raw = false, boolean $full = true ) : string
$raw boolean Whether to output the URL in the raw URL format or HTML-encoded.
$full boolean Output the full URL?
Результат string The string representation of this object.

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

Add a unique parameter to the URL to aid in cache-busting.
public unique ( ) : Horde_Url
Результат Horde_Url This (modified) object, to allow chaining.

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

Decode URL-safe base64 data, dealing with missing '='.
public static uriB64Decode ( string $string ) : string
$string string Encoded data.
Результат string Decoded data.

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

URL-safe base64 encoding, with trimmed '='.
public static uriB64Encode ( string $string ) : string
$string string String to encode.
Результат string URL-safe, base64 encoded data.

Описание свойств

$_cache защищенное свойство

Cached parameter list for use in toString().
protected array $_cache
Результат array

$anchor публичное свойство

The anchor string (a/k/a fragment).
public string $anchor
Результат string

$parameters публичное свойство

The keys are paramter names, the values parameter values. Array values will be added to the URL using name[]=value notation.
public array $parameters
Результат array

$pathInfo публичное свойство

Any PATH_INFO to be added to the URL.
public string $pathInfo
Результат string

$raw публичное свойство

Whether to output the URL in the raw URL format or HTML-encoded.
public bool $raw
Результат boolean

$toStringCallback публичное свойство

A callback function to use when converting to a string.
public callback $toStringCallback
Результат callback

$url публичное свойство

The basic URL, without query parameters.
public string $url
Результат string