Class to build frontend urls for advandced mod rewrite plugin.

Extends abstract Contenido_UriBuilder class and implements singleton pattern.

Usage:

cInclude('classes', 'uri/class.uriBuilder.MR.php');
$url = 'front_content.php?idart=123';
$mrUriBuilder = cUriBuilderMR::getInstance();
$mrUriBuilder->buildUrl(array($url));
$newUrl = $mrUriBuilder->getUrl();
todo Add handling of absolute paths, standardize handling of fragments
author Murat Purc
package CONTENIDO Plugins
subpackage ModRewrite

 Methods

Builds a URL based on defined mod rewrite settings.

buildUrl(array $params, boolean $bUseAbsolutePath) : string

Index keys of $aParams will be used as "a", corresponding values as "1" in this sample.

Parameters

$params

array

Parameter array, provides only following parameters: $params[0] = 'front_content.php?idart=123...'

$bUseAbsolutePath

boolean

Flag to use absolute path (not used at the moment)

Exceptions

\cInvalidArgumentException

Returns

stringNew build url

Return http base path, e.g.

getHttpBasePath() : string
Inherited

http://contenido.org/

inherited_from \cUriBuilder::getHttpBasePath()

Returns

string

Returns a instance of cUriBuilderMR

getInstance() : \cUriBuilderMR
Static

It is meant to be an abstract function but not declared as abstract, because PHP Strict Standards are against abstract static functions.

Exceptions

\cBadMethodCallException If child class has not implemented this function

Returns

Return built URL

getUrl() : string
Inherited
inherited_from \cUriBuilder::getUrl()

Returns

string

Set http base path, e.g.

setHttpBasePath($sBasePath) : void
Inherited

http://contenido.org/

inherited_from \cUriBuilder::setHttpBasePath()

Parameters

$sBasePath

Constructor, tries to set some member variables.

__construct() 

Builds the SEO-URL by analyzing passed arguments (parameter value pairs)

_buildUrl(array $aParams) : string

Parameters

$aParams

array

Parameter array

Returns

stringNew build pretty url

Loops thru passed parameter array and creates the query part of the URL.

_createUrlQueryPart(array $aArgs) : string

All non CONTENIDO related parameter will be excluded from composition.

Parameters

$aArgs

array

Assoziative parameter array

Returns

stringComposed query part for the URL like '?foo=bar&param=value'

Returns articlename depending on current setting

_getArticleName(array $aPretty, array $aArgs) : string

Parameters

$aPretty

array

Pretty url array

$aArgs

array

Additional arguments

Returns

stringArticlename

Returns client id or name depending on settings.

_getClientParameter(array $aArgs) : mixed

Parameters

$aArgs

array

Additional arguments

Returns

mixedClient id, client name or null

Returns language id or name depending on settings.

_getLanguageParameter(array $aArgs) : mixed

Parameters

$aArgs

array

Additional arguments

Returns

mixedLanguage id, language name or null

Returns composed path of url (normally the category structure)

_getPath(array $aPretty) : string

Parameters

$aPretty

array

Pretty url array

Returns

stringPath

 Properties

 

$sHttpBasePath : string
Inherited

http://contenido.org/

inherited_from \cUriBuilder::$$sHttpBasePath
 

$sUrl : string
Inherited
inherited_from \cUriBuilder::$$sUrl
 

$_aMrCfg : array
 

$_bIsXHTML : bool
 

$_bMREnabled : bool
 

$_instance : \cUriBuilderMR
 

$_sAmp : string