cms_url View code

A class for interacting with a URL.

package

CMS

author

Robert Campbell

copyright

Copyright (c) 2010, Robert Campbell calguy1000@cmsmadesimple.org

since 1.9

Methods

__construct(string $url = '') 

Constructor

Arguments

string $url

the url to work with

get_orig() : string

Return the original url

Response

string

get_scheme() : string

Return the URL scheme. i.e: HTTP, HTTPS, ftp etc.

Response

string

(may be empty)

set_scheme(string $val) 

Set the URL scheme

Arguments

string $val

The url scheme.

get_host() : string

Return the host part of the URL may return an empty string if the input url does not have a host part.

Response

string

(may be empty)

set_host(string $val) 

Set the URL host

Arguments

string $val

The url hostname.

get_port() : integer

Return the port part of the URL may return an empty string if the input url does not have a port portion.

Response

integer

(may be empty)

set_port(integer $val) 

Set the URL port

Arguments

integer $val

the URL port number.

get_user() : string

Return the user part of the URL, if any.

may return an empty string if the input url does not have a username portion.

Response

string

(may be empty)

set_user(string $val) 

Set the user portion of the URL. An empty string is accepted Note: usually one must set the password if setting the username.

Arguments

string $val

The username

get_pass() : string

Retrieve the password portion of the URL, if any.

Response

string

(may be empty)

set_pass(string $val) 

Set the password portion of the URL. Empty string is accepted Usually when setting the password, the username portion is also required on a URL.

Arguments

string $val

The password

get_path() : string

Return the path portion of the URL. This may be empty

Response

string

set_path(string $val) 

Set the path portion of the URL. An empty string is accepted.

Arguments

string $val

(may be empty)

get_query() : string

Return the the query portion of the URL, if any is set.

Response

string

(may be empty)

set_query(string $val) 

Set the query portion of the URL. An empty string is accepted

Arguments

string $val

(may be empty)

get_fragment() : string

Return the fragement portion of the URL

Response

string

set_fragment(string $val) 

Set the fragment portion of the url.

Arguments

string $val

queryvar_exists(string $key) 

Test if the named query variable exists in the URL

Arguments

string $key

erase_queryvar(string $key) 

Erase a query var if it exists.

Arguments

string $key

get_queryvar(string $key) 

Retrieve a query var from the url.

Arguments

string $key

set_queryvar(string $key, string $value) 

Set a query var into the url

Arguments

string $key

string $value