Parses the url and makes it accessible through an instance of this object.

author Jorgen Evens
package WebLab
subpackage Parser

 Methods

Constructs a new URL Parser.

__construct($url) 

Parameters

$url

Retrieves property by name

__get(String $method) : Object | bool

Parameters

$method

String

The name of the property to get.

Returns

ObjectboolIf the requested property exists its value is returned. Otherwise false is returned.

Defines URL constants such as BASE and RES_BASE, basepath and resource basepath.

defineConstants() 

Escapes an url to a browser and user friendly version.

escape(String $url) 
Static

Parameters

$url

String

Get a collection of URL values

get(Array $values) : Array
deprecated

Parameters

$values

Array

Names of the values you want to retrieve.

Returns

ArrayReturns the computed values for the requested values.

The basepath for urls.

getBasePath() : String

This path exists out of document_root/folder/to/application/

deprecated use BASE_PATH instead.

Returns

StringPath to the current application root.

The Full Base URL of the website.

getBaseURL() : String

Returns

StringReturns the full base URL.

Get the relative path to the current install

getDirectory() : String

Returns

StringThe absolute path to this application.

Returns the URL Parser for the current request.

getForRequest() : \WebLab_Parser_URL
Static

The full URL of the current page.

getFullURL() : String

Returns

StringReturns the full URL.

Get the hostname.

getHostname() : String

Returns

StringShorthand for $_SERVER['HTTP_HOST']

Retrieve a single parameter by $key

getParameter(String $key) 

Parameters

$key

String

The key to retrieve.

Get the parameters supplied through URL This is everything behind the basepath and the $_GET parameter

getParameters() : Array

Returns

ArrayEverything behind the basepath and the $_GET parameter as an array.

Get the path used to access this page.

getPath() : String

Returns

StringThe path of the URL that is currently being viewed.

Get the port on which the server is running.

getPort() : Integer

Returns

IntegerLocked at 80 for now.

Get the protocol used to load this page.

getProtocol() : String

Returns

StringLocked at http for now.

The name of the current script running.

getScriptname() : String

This will probably be your entry page, mostly index.php

Returns

StringThe name of the current script running. This will probably be your entry page, mostly index.php

 Properties

 

$_parameters : array
 

$_request_url : \WebLab_Parser_URL
 

$_url : Array