eZPublishCommunityProject(LegacyStack)  2013.9
eZURI Class Reference

Public Member Functions

 __construct ($uri)
 Initializes with the URI string $uri. More...
 
 attribute ($attr)
 Get value for an attribute. More...
 
 attributes ()
 Export all attributes of the object. More...
 
 base ($as_text=true)
 Return the elements before pointer. More...
 
 convertFilterString ()
 Converts filter string to current locale. More...
 
 dropBase ()
 Removes all elements below the current index, recreates the URI string and sets index to 0. More...
 
 element ($index=0, $relative=true)
 Get element index from uri. More...
 
 elements ($as_text=true)
 Return all URI elements. More...
 
 hasAttribute ($attr)
 Check if attribute exsits. More...
 
 increase ($num=1)
 Moves the index 1 step up or $num if specified. More...
 
 index ()
 Return the current position of pointer. More...
 
 isEmpty ()
 Check if there URI is set. More...
 
 matchBase (eZURI $uri)
 Tries to match the base of $uri against this base and returns the result. More...
 
 originalURIString ($withLeadingSlash=false)
 Return the original URI. More...
 
 setURIString ($uri, $fullInitialize=true)
 Sets uri string for instance. More...
 
 toBeginning ()
 Reset the internal pointer. More...
 
 toEnd ()
 Moves the index to the end. More...
 
 uriString ($withLeadingSlash=false)
 Get the uri string. More...
 
 userParameters ()
 Get user variables. More...
 

Static Public Member Functions

static codecURL ($url, $encode)
 Parse URL and encode/decode its path string. More...
 
static decodeIRI ($str)
 Decodes a path string which is in IRI format and returns the new path in the internal encoding. More...
 
static decodeURL ($url)
 Decodes URL which has path string is in IRI format and returns the new URL with path in the internal encoding. More...
 
static encodeIRI ($str)
 Encodes path string in internal encoding to a new string which conforms to the IRI specification. More...
 
static encodeURL ($url)
 Encodes path string of URL in internal encoding to a new string which conforms to the IRI specification. More...
 
static getTransformURIMode ()
 Returns the current mode used for transformURI(). More...
 
static instance ($uri=false)
 Returns a shared instance of the eZURI class IF $uri is false or the same as current request uri, if not then a new non shared instance is created. More...
 
static setTransformURIMode ($mode)
 Sets the current mode used for transformURI() to $mode. More...
 
static transformURI (&$href, $ignoreIndexDir=false, $serverURL=null)
 Implementation of an 'ezurl' template operator Makes valid eZ Publish urls to use in links. More...
 

Public Attributes

 $Index
 
 $URI
 
 $URIArray
 
 $UserArray
 

Static Private Attributes

static $transformURIMode = "relative"
 

Constructor & Destructor Documentation

eZURI::__construct (   $uri)

Initializes with the URI string $uri.

The URI string is split on / into an array.

Parameters
string$urithe URI to use
Returns
void

Member Function Documentation

eZURI::attribute (   $attr)

Get value for an attribute.

Parameters
string$attr
Returns
boolean the value for attribute $attr or null if it does not exist.
eZURI::attributes ( )

Export all attributes of the object.

Returns
array the attributes for the object

Referenced by hasAttribute().

eZURI::base (   $as_text = true)

Return the elements before pointer.

Parameters
type$as_textreturn as text or array
Returns
string|array the base string or the base elements as an array if $as_text is true.

Referenced by attribute().

static eZURI::codecURL (   $url,
  $encode 
)
static

Parse URL and encode/decode its path string.

Parameters
string$urlthe URL to parse
boolean$encodetells to encode the URI
Returns
string the parsed url

Referenced by decodeURL(), and encodeURL().

eZURI::convertFilterString ( )

Converts filter string to current locale.

When an user types in browser url like: "/content/view/full/2/(namefilter)/a" 'a' letter should be urldecoded and converted from utf-8 to current locale.

Returns
string converted string

Referenced by setURIString().

static eZURI::decodeIRI (   $str)
static

Decodes a path string which is in IRI format and returns the new path in the internal encoding.

More info on IRI here: http://www.w3.org/International/O-URL-and-ident.html

Parameters
string$strthe string to decode
Returns
string decoded version of $str

Referenced by codecURL(), and setURIString().

static eZURI::decodeURL (   $url)
static

Decodes URL which has path string is in IRI format and returns the new URL with path in the internal encoding.

Parameters
string$urlurl to decode
Returns
string the decoded url
eZURI::dropBase ( )

Removes all elements below the current index, recreates the URI string and sets index to 0.

Returns
void

Referenced by eZSiteAccess\match().

eZURI::element (   $index = 0,
  $relative = true 
)

Get element index from uri.

Parameters
integer$indexthe index of URI to return
boolean$relativeif index is relative to the internal pointer
Returns
string|null the element at $index

Referenced by eZModule\accessAllowed(), attribute(), fetchModule(), eZSiteAccess\match(), and eZURLAliasML\urlTranslationEnabledByUri().

eZURI::elements (   $as_text = true)

Return all URI elements.

Parameters
boolean$as_textreturn the elements as string
Returns
array|string all elements as string/array depending on $as_text

Referenced by attribute(), fetchModule(), and eZSiteAccess\match().

static eZURI::encodeIRI (   $str)
static

Encodes path string in internal encoding to a new string which conforms to the IRI specification.

More info on IRI here: http://www.w3.org/International/O-URL-and-ident.html

Parameters
string$strthe IRI to encode
Returns
string $str encoded as IRU

Referenced by codecURL().

static eZURI::encodeURL (   $url)
static

Encodes path string of URL in internal encoding to a new string which conforms to the IRI specification.

Parameters
type$url
Returns
string the encoded url

Referenced by eZHTTPTool\redirect(), and ezpKernelWeb\redirect().

static eZURI::getTransformURIMode ( )
static

Returns the current mode used for transformURI().

See Also
transformURI()
setTransformURIMode()
Returns
string

Referenced by eZURLOperator\urlTransformation().

eZURI::hasAttribute (   $attr)

Check if attribute exsits.

Parameters
string$attrthe attrbiute to check if exists
Returns
boolean
eZURI::increase (   $num = 1)

Moves the index 1 step up or $num if specified.

Parameters
int$numnumber of steps to move pointer
Returns
void

Referenced by fetchModule(), and eZSiteAccess\match().

eZURI::index ( )

Return the current position of pointer.

Returns
int the current pointer position.

Referenced by attribute().

static eZURI::instance (   $uri = false)
static

Returns a shared instance of the eZURI class IF $uri is false or the same as current request uri, if not then a new non shared instance is created.

Parameters
bool | string$uriShared uri instance if false
Returns
eZURI

Referenced by ezpKernelTreeMenu\__construct(), ezpKernelWeb\__construct(), ezpKernelWeb\dispatchLoop(), ezpKernelWeb\redirect(), and ezpKernelWeb\requestInit().

eZURI::isEmpty ( )

Check if there URI is set.

Returns
boolean true if the URI is empty, ie it's equal to / or empty string.

Referenced by eZURLAliasML\urlTranslationEnabledByUri().

eZURI::matchBase ( eZURI  $uri)

Tries to match the base of $uri against this base and returns the result.

A match is made if all elements of this object match the base elements of the $uri object, this means that $uri's base may be longer than this base but not shorter.

Parameters
eZURI$urithe uri to match against
Returns
boolean
eZURI::originalURIString (   $withLeadingSlash = false)

Return the original URI.

the URI will not include the leading / if $withLeadingSlash is true.

Parameters
boolean$withLeadingSlashprefix the uri with /
Returns
string the URI passed to the object with user parameters (if any).

Referenced by attribute().

static eZURI::setTransformURIMode (   $mode)
static

Sets the current mode used for transformURI() to $mode.

See Also
transformURI()
getTransformURIMode()
Parameters
string$mode
eZURI::setURIString (   $uri,
  $fullInitialize = true 
)

Sets uri string for instance.

Sets the current URI string to $uri, the URI is then split into array elements and index reset to 1.

Parameters
string$uri
boolean$fullInitialize
Returns
void

Referenced by __construct(), and eZSiteAccess\match().

eZURI::toBeginning ( )

Reset the internal pointer.

Returns
void
eZURI::toEnd ( )

Moves the index to the end.

Returns
void
static eZURI::transformURI ( $href,
  $ignoreIndexDir = false,
  $serverURL = null 
)
static

Implementation of an 'ezurl' template operator Makes valid eZ Publish urls to use in links.

Parameters
string&$href
boolean$ignoreIndexDir
string$serverURLfull|relative
Returns
string the link to use

Referenced by eZRSSExport\generateFeed(), eZTemplatesStatisticsReporter\generateStatistics(), eZURLOperator\modify(), eZDebug\printReport(), ezpLanguageSwitcher\process(), and eZURLOperator\urlTransformation().

eZURI::uriString (   $withLeadingSlash = false)

Get the uri string.

The URI will not include the leading / if $withLeadingSlash is true.

Parameters
boolean$withLeadingSlashprefix the uri with /
Returns
string the URI passed as to the object

Referenced by attribute().

eZURI::userParameters ( )

Get user variables.

Returns
array all the user defined variables

Member Data Documentation

eZURI::$Index

Referenced by element(), and index().

eZURI::$transformURIMode = "relative"
staticprivate
eZURI::$URI

Referenced by dropBase(), and uriString().

eZURI::$URIArray
eZURI::$UserArray

Referenced by userParameters().


The documentation for this class was generated from the following file: