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 29)

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])
static jIUrlEngine getEngine ([ $reset = false])
static jUrlAction parse (string $scriptNamePath, string $pathinfo, array $params)
static jUrlAction parseFromRequest (jRequest $request, 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 51)

path info part of the url

  • access: public
string $scriptName (line 45)

script name including its path

  • access: public

Inherited Variables

Inherited from jUrlBase

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

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 200)

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 155)

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 113)

get current Url

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

return the current url engine

static jIUrlEngine getEngine ([ $reset = false])
  • $reset
static parse (line 178)

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 parseFromRequest (line 189)

Parse a url from the request

  • since: 1.1
static jUrlAction parseFromRequest (jRequest $request, array $params)
  • jRequest $request
  • array $params: url parameters ($_REQUEST, or $_GET)
static unescape (line 232)

perform the opposit of escape

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

constructor

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

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

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

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 71)

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 37)

constant for get() method

JURLACTION = 3 (line 38)

constant for get() method

STRING = 0 (line 35)

constant for get() method

XMLSTRING = 1 (line 36)

constant for get() method

Documentation generated on Thu, 22 Mar 2012 22:17:30 +0100 by phpDocumentor 1.4.3