Class jUrl

Description

Object that contains url data, and which provides static method helpers

  • author: Gerald Croes (for the original code from Copix)
  • author: Laurent Jouanneau (for the original code from Copix and enhancement for jelix)
  • copyright: 2005-2006 Laurent Jouanneau
  • contributor: Thibault Piront (nuKs)
  • contributor: Loic Mathaud

Located in /core/jUrl.class.php (line 30)

jUrlBase
   |
   --jUrl
Class Constant Summary
 JURL = 2
 STRING = 0
 XMLSTRING = 1
Variable Summary
string $pathInfo
string $scriptName
Method Summary
static string appendToUrlString (string $url, [array $params = array ()], [boolean $forxml = false])
static string escape (string $str, [boolean $highlevel = false])
static mixed get (string $actSel, [array $params = array ()], [integer $what = 0])
static string getCurrentUrl ([boolean $forxml = false], [ $full = false])
static jIUrlEngine getEngine ([ $reset = false])
static string getFull (string $actSel, [array $params = array ()], [integer $what = 0], [string $domainName = null])
static string getRootUrl (string $ressourceType)
static string getRootUrlRessourceValue (string $ressourceType)
static jUrlAction parse (string $scriptNamePath, string $pathinfo, array $params)
static string unescape (string $str)
jUrl __construct ([string $scriptname = ''], [array $params = array ()], [string $pathInfo = ''])
string getPath ()
string getQuery ([boolean $forxml = false])
string toString ([boolean $forxml = false])
Variables
string $pathInfo = '' (line 52)

path info part of the url

  • access: public
string $scriptName (line 46)

script name including its path

  • access: public

Inherited Variables

Inherited from jUrlBase

jUrlBase::$params
Methods
static appendToUrlString (line 138)

Adds parameters to the given url

  • return: the url
static string appendToUrlString (string $url, [array $params = array ()], [boolean $forxml = false])
  • string $url: an URL
  • array $params: some parameters to append to the url
  • boolean $forxml: if true, escape some characters to include the url into an html/xml document
static escape (line 228)

escape and simplier a string to be a part of an url path remove or replace not allowed characters etc..

  • return: escaped string
static string escape (string $str, [boolean $highlevel = false])
  • string $str: the string to escape
  • boolean $highlevel: false : just to a urlencode. true, replace some characters
static get (line 158)

Gets the url corresponding to an action, in the given format

  • return: a value, depending of the $what parameter
static mixed get (string $actSel, [array $params = array ()], integer $what)
  • string $actSel: action selector. You can use # instead of the module or the action name, to specify the current url.
  • array $params: associative array with the parameters
  • integer $what: the format you want : one of the jUrl const, STRING XMLSTRING JURL JURLACTION
static getCurrentUrl (line 117)

returns the current Url.

The URL is the URL for the frontend HTTP server, if your app is behind a proxy.

  • return: the url
static string getCurrentUrl ([boolean $forxml = false], [ $full = false])
  • boolean $forxml: if true, escape some characters to include the url into an html/xml document
  • $full
static getEngine (line 269)

return the current url engine

static jIUrlEngine getEngine ([ $reset = false])
  • $reset
static getFull (line 184)

Gets the absolute url corresponding to an action, in the given format with

the domainName in defaultConfig or current

  • return: the url string
static string getFull (string $actSel, [array $params = array ()], integer $what, [string $domainName = null])
  • string $actSel: action selector. You can use # instead of the module or the action name, to specify the current url.
  • array $params: associative array with the parameters
  • integer $what: the format you want : only jUrl::STRING or jUrl::XMLSTRING
  • string $domainName: Customized domain name
static getRootUrl (line 289)

get the root url for a given ressource type. Root URLs are stored in config file.

  • return: the root URL corresponding to this ressource, or basePath if unknown
  • access: public
static string getRootUrl (string $ressourceType)
  • string $ressourceType: Name of the ressource
static getRootUrlRessourceValue (line 312)

get the config value of an item in [rootUrls] section of config

  • return: the config value of this value, null if it does not exist
  • access: public
static string getRootUrlRessourceValue (string $ressourceType)
  • string $ressourceType: Name of the ressource
static parse (line 217)

Parse a url

static jUrlAction parse (string $scriptNamePath, string $pathinfo, array $params)
  • string $scriptNamePath: /path/index.php
  • string $pathinfo: the path info of the url.
  • array $params: url parameter ($_REQUEST)
static unescape (line 260)

perform the opposit of escape

static string unescape (string $str)
  • string $str: the string to escape
Constructor __construct (line 60)

constructor

jUrl __construct ([string $scriptname = ''], [array $params = array ()], [string $pathInfo = ''])
  • string $scriptname: script name
  • array $params: parameters
  • string $pathInfo: path info contents
getPath (line 81)

get the path part of the url (scriptName + pathinfo)

  • since: 1.0.4
  • access: public
string getPath ()
getQuery (line 96)

get the query part of the url

  • since: 1.0.4
  • access: public
string getQuery ([boolean $forxml = false])
  • boolean $forxml: true: some characters will be escaped
toString (line 72)

converts the url to a string

  • access: public
string toString ([boolean $forxml = false])
  • boolean $forxml: true: some characters will be escaped

Redefinition of:
jUrlBase::toString()
get the url string corresponding to the url/action

Inherited Methods

Inherited From jUrlBase

jUrlBase::clearParam()
jUrlBase::delParam()
jUrlBase::getParam()
jUrlBase::setParam()
jUrlBase::toString()
jUrlBase::__toString()
Class Constants
JURL = 2 (line 38)

constant for get() method

JURLACTION = 3 (line 39)

constant for get() method

STRING = 0 (line 36)

constant for get() method

XMLSTRING = 1 (line 37)

constant for get() method

Documentation generated on Mon, 26 Oct 2015 21:56:42 +0100 by phpDocumentor 1.4.3