CMS Made Simple API

cms_url
in package

A class for interacting with a URL.

Tags
author

Robert Campbell

copyright

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

since
1.9

Table of Contents

Methods

__construct()  : mixed
Constructor
erase_queryvar()  : mixed
Erase a query var if it exists.
get_fragment()  : string
Return the fragement portion of the URL
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.
get_orig()  : string
Return the original url
get_pass()  : string
Retrieve the password portion of the URL, if any.
get_path()  : string
Return the path portion of the URL. This may be empty
get_port()  : int
Return the port part of the URL may return an empty string if the input url does not have a port portion.
get_query()  : string
Return the the query portion of the URL, if any is set.
get_queryvar()  : mixed
Retrieve a query var from the url.
get_scheme()  : string
Return the URL scheme. i.e: HTTP, HTTPS, ftp etc.
get_user()  : string
Return the user part of the URL, if any.
queryvar_exists()  : mixed
Test if the named query variable exists in the URL
set_fragment()  : mixed
Set the fragment portion of the url.
set_host()  : mixed
Set the URL host
set_pass()  : mixed
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.
set_path()  : mixed
Set the path portion of the URL. An empty string is accepted.
set_port()  : mixed
Set the URL port
set_query()  : mixed
Set the query portion of the URL. An empty string is accepted
set_queryvar()  : mixed
Set a query var into the url
set_scheme()  : mixed
Set the URL scheme
set_user()  : mixed
Set the user portion of the URL. An empty string is accepted Note: usually one must set the password if setting the username.

Methods

__construct()

Constructor

public __construct([string $url = '' ]) : mixed
Parameters
$url : string = ''

the url to work with

erase_queryvar()

Erase a query var if it exists.

public erase_queryvar(string $key) : mixed
Parameters
$key : string
Tags
since
2.0.1

get_fragment()

Return the fragement portion of the URL

public get_fragment() : string
Return values
string

get_host()

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

public get_host() : string
Return values
string

(may be empty)

get_orig()

Return the original url

public get_orig() : string
Return values
string

get_pass()

Retrieve the password portion of the URL, if any.

public get_pass() : string
Return values
string

(may be empty)

get_path()

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

public get_path() : string
Return values
string

get_port()

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

public get_port() : int
Return values
int

(may be empty)

get_query()

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

public get_query() : string
Return values
string

(may be empty)

get_queryvar()

Retrieve a query var from the url.

public get_queryvar(string $key) : mixed
Parameters
$key : string

get_scheme()

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

public get_scheme() : string
Return values
string

(may be empty)

get_user()

Return the user part of the URL, if any.

public get_user() : string

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

Return values
string

(may be empty)

queryvar_exists()

Test if the named query variable exists in the URL

public queryvar_exists(string $key) : mixed
Parameters
$key : string

set_fragment()

Set the fragment portion of the url.

public set_fragment(string $val) : mixed
Parameters
$val : string

set_host()

Set the URL host

public set_host(string $val) : mixed
Parameters
$val : string

The url hostname.

set_pass()

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.

public set_pass(string $val) : mixed
Parameters
$val : string

The password

set_path()

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

public set_path(string $val) : mixed
Parameters
$val : string

(may be empty)

set_port()

Set the URL port

public set_port(int $val) : mixed
Parameters
$val : int

the URL port number.

set_query()

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

public set_query(string $val) : mixed
Parameters
$val : string

(may be empty)

set_queryvar()

Set a query var into the url

public set_queryvar(string $key, string $value) : mixed
Parameters
$key : string
$value : string

set_scheme()

Set the URL scheme

public set_scheme(string $val) : mixed
Parameters
$val : string

The url scheme.

set_user()

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

public set_user(string $val) : mixed
Parameters
$val : string

The username


        
On this page

Search results