Url Class Reference

Public Member Functions

 __construct ($url= '')
 __get ($name)
 __set ($name, $value)
 relayCurrentContext ()
 relayContext ($context)
 addParamList ($paramList, $overwrite=false)
 addParam ($name, $value)
 replaceParam ($name, $value, $addIfMissing=false)
 removeParam ($name, $ignoreMissing=false)
 toUrl ()
 __toString ()

Static Public Member Functions

static Contextualize ($url, $context=null)

Protected Attributes

 $url

Detailed Description

Class to manipulate Urls

Definition at line 20 of file url.lib.php.


Constructor & Destructor Documentation

__construct ( url = ''  ) 

Constructor

Parameters:
string url base url (use PHP_SELF if missing)

Definition at line 38 of file url.lib.php.


Member Function Documentation

__get ( name  ) 

Definition at line 62 of file url.lib.php.

__set ( name,
value 
)

Definition at line 74 of file url.lib.php.

__toString (  ) 
Since:
Claroline 1.10
Returns:
string

Definition at line 278 of file url.lib.php.

addParam ( name,
value 
)

Add one parameter to the current url

Parameters:
string $name parameter name
string $value parameter value
Returns:
$this

Definition at line 154 of file url.lib.php.

addParamList ( paramList,
overwrite = false 
)

Add a list of parameters to the current url

Parameters:
array $paramList associative array of parameters name=>value
boolean $overwrite will overwrite the value of an existing parameter if set to true
Returns:
$this

Definition at line 128 of file url.lib.php.

static Contextualize ( url,
context = null 
) [static]

Add current execution context to the given URL

Parameters:
string $url
array $context
Returns:
string

Definition at line 289 of file url.lib.php.

relayContext ( context  ) 

Relay given Url context in urls

Parameters:
array context
Returns:
$this

Definition at line 114 of file url.lib.php.

relayCurrentContext (  ) 

Relay Claroline current Url context in urls

Returns:
$this

Definition at line 86 of file url.lib.php.

removeParam ( name,
ignoreMissing = false 
)

Remove the given parameter

Parameters:
string $name parameter name
boolean $ignoreMissing if set to true, the method invokation will ignore a missing parameter. If set to false (default) removing a non existent parameter will generate an exception
Returns:
$this
Exceptions:
Exception if trying to remove a non existent parameter with $ignoreMissing set to false (default)

Definition at line 196 of file url.lib.php.

replaceParam ( name,
value,
addIfMissing = false 
)

Replace the value of the given parameter with the given value

Parameters:
string $name parameter name
string $value parameter value
boolean $addIfMissing add the parameter if missing (default false)
Returns:
$this
Exceptions:
Exception if trying to modify a non existent parameter with $addIfMissing set to false (default)

Definition at line 173 of file url.lib.php.

toUrl (  ) 

Convert the current Url object to an URL string

Returns:
string

Definition at line 218 of file url.lib.php.


Field Documentation

$url [protected]
Initial value:
 array(
        'scheme' => '',
        'host' => '',
        'port' => '',
        'user' => '',
        'pass' => '',
        'path' => '',
        'query' => array(),
        'fragment' => ''
    )

Definition at line 22 of file url.lib.php.


The documentation for this class was generated from the following file:
Generated on Tue Jun 8 12:28:40 2010 for Claroline API by  doxygen 1.6.3