Overview

Packages

  • Url

Classes

  • Horde_Url
  • Horde_Url_Exception
  • Overview
  • Package
  • Class
  • Tree

Class Horde_Url

The Horde_Url class represents a single URL and provides methods for manipulating URLs.

Package: Url
Category: Horde
Author: Jan Schneider jan@horde.org
Author: Michael Slusarz slusarz@horde.org
Located at Horde/Url.php
Methods summary
public
# __construct( string $url, boolean $raw = null )

Constructor.

Constructor.

Parameters

$url
The basic URL, with or without query parameters.
$raw
<p>Whether to output the URL in the raw URL format or HTML-encoded.</p>
public Horde_Url
# copy( )

Returns a clone of this object. Useful for chaining.

Returns a clone of this object. Useful for chaining.

Returns

Horde_Url
A clone of this object.
public Horde_Url
# add( mixed $parameters, string $value = null )

Adds one or more query parameters.

Adds one or more query parameters.

Parameters

$parameters
<p>Either the name value or an array of name/value pairs.</p>
$value
<p>If specified, the value part ($parameters is then assumed to just be the parameter name).</p>

Returns

Horde_Url
This (modified) object, to allow chaining.
public Horde_Url
# remove( mixed $parameters )

Removes one ore more parameters.

Removes one ore more parameters.

Parameters

$parameters
<p>$remove Either a single parameter to remove or an array of parameters to remove.</p>

Returns

Horde_Url
This (modified) object, to allow chaining.
public Horde_Url
# setAnchor( string $anchor )

Sets the URL anchor.

Sets the URL anchor.

Parameters

$anchor
An anchor to add.

Returns

Horde_Url
This (modified) object, to allow chaining.
public Horde_Url
# setRaw( boolean $raw )

Sets the $raw value. This call can be chained.

Sets the $raw value. This call can be chained.

Parameters

$raw
<p>Whether to output the URL in the raw URL format or HTML-encoded.</p>

Returns

Horde_Url
This object, to allow chaining.
public string
# toString( boolean $raw = false, boolean $full = true )

Creates the full URL string.

Creates the full URL string.

Parameters

$raw
<p>Whether to output the URL in the raw URL format or HTML-encoded.</p>
$full
Output the full URL?

Returns

string
The string representation of this object.
public string
# __toString( )

Creates the full URL string.

Creates the full URL string.

Returns

string
The string representation of this object.
public string
# link( array $attributes = array() )

Generates a HTML link tag out of this URL.

Generates a HTML link tag out of this URL.

Parameters

$attributes
<p>A hash with any additional attributes to be added to the link. If the attribute name is suffixed with ".raw", the attribute value won't be HTML-encoded.</p>

Returns

string
An tag representing this URL.
public Horde_Url
# unique( )

Add a unique parameter to the URL to aid in cache-busting.

Add a unique parameter to the URL to aid in cache-busting.

Returns

Horde_Url
This (modified) object, to allow chaining.
public
# redirect( )

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

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

Throws

Horde_Url_Exception
public static string
# uriB64Encode( string $string )

URL-safe base64 encoding, with trimmed '='.

URL-safe base64 encoding, with trimmed '='.

Parameters

$string
String to encode.

Returns

string
URL-safe, base64 encoded data.
public static string
# uriB64Decode( string $string )

Decode URL-safe base64 data, dealing with missing '='.

Decode URL-safe base64 data, dealing with missing '='.

Parameters

$string
Encoded data.

Returns

string
Decoded data.
Properties summary
public string $url

The basic URL, without query parameters.

The basic URL, without query parameters.

#
public boolean $raw

Whether to output the URL in the raw URL format or HTML-encoded.

Whether to output the URL in the raw URL format or HTML-encoded.

#
public array $parameters

The query parameters.

The query parameters.

The keys are paramter names, the values parameter values. Array values will be added to the URL using name[]=value notation.

# array()
public string $pathInfo

Any PATH_INFO to be added to the URL.

Any PATH_INFO to be added to the URL.

#
public string $anchor

The anchor string.

The anchor string.

# ''
public callable $toStringCallback

A callback function to use when converting to a string.

A callback function to use when converting to a string.

#
API documentation generated by ApiGen