Class Contenido_UrlBuilder_MR

Description

Class to build frontend urls for advandced mod rewrite plugin.

Extends abstract Contenido_UrlBuilder class and implements singleton pattern.

Usage:

  1.  cInclude('classes''UrlBuilder/Contenido_UrlBuilder_MR.class.php');
  2.  $url 'front_content.php?idart=123';
  3.  $mrUrlBuilder Contenido_UrlBuilder_MR::getInstance();
  4.  $mrUrlBuilder->buildUrl(array($url));
  5.  $newUrl $mrUrlBuilder->getUrl();

  • author: Murat Purc <murat@purc.de>
  • copyright: © Murat Purc 2008
  • todo: Add handling of absolute paths, standardize handling of fragments

Located in /contenido/classes/UrlBuilder/Contenido_UrlBuilder_MR.class.php (line 51)

Contenido_UrlBuilder
   |
   --Contenido_UrlBuilder_MR
Variable Summary
Method Summary
 Contenido_UrlBuilder_MR __construct ()
 string buildUrl ( $params, [boolean $bUseAbsolutePath = false])
 string _buildUrl ( $aParams)
 string _createUrlQueryPart ( $aArgs)
 string _getArticleName ( $aPretty,  $aArgs)
 mixed _getClientParameter ( $aArgs)
 mixed _getLanguageParameter ( $aArgs)
 string _getPath ( $aPretty)
Variables
static Contenido_UrlBuilder_MR $_instance (line 58)

Self instance

  • access: private
array $_aMrCfg = null (line 93)

Mod Rewrite configuration

  • access: private
bool $_bIsXHTML = false (line 79)

Is XHTML output?

  • access: private
bool $_bMREnabled = false (line 86)

Is mod rewrite enabled?

  • access: private
Contenido_mpDebug $_oDebug (line 65)

Debugger instance

  • access: private
string $_sAmp = '&amp;' (line 72)

Ampersant used for composing several parameter value pairs

  • access: private
Methods
static getInstance (line 116)

Returns a instance of Contenido_UrlBuilder_MR

  • access: public
Contenido_UrlBuilder_MR getInstance ()
Constructor __construct (line 99)

Constructor, tries to set some member variables.

  • access: private
Contenido_UrlBuilder_MR __construct ()
buildUrl (line 134)

Builds a URL based on defined mod rewrite settings.

  • return: New build url
  • access: public
string buildUrl ( $params, [boolean $bUseAbsolutePath = false])
  • array $params: Parameter array, provides only following parameters:
    1.  $params[0'front_content.php?idart=123...'
  • boolean $bUseAbsolutePath: Flag to use absolute path (not used at the moment)
_buildUrl (line 161)

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

  • return: New build pretty url
  • access: private
string _buildUrl ( $aParams)
  • array $aParams: Parameter array
_createUrlQueryPart (line 236)

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

All non Contenido related parameter will be excluded from composition.

  • return: Composed query part for the URL like '?foo=bar&amp;param=value'
  • access: private
string _createUrlQueryPart ( $aArgs)
  • array $aArgs: Assoziative parameter array
_getArticleName (line 336)

Returns articlename depending on current setting

  • return: Articlename
  • access: private
string _getArticleName ( $aPretty,  $aArgs)
  • array $aPretty: Pretty url array
  • array $aArgs: Additional arguments
_getClientParameter (line 268)

Returns client id or name depending on settings.

  • return: Client id, client name or null
  • access: private
mixed _getClientParameter ( $aArgs)
  • array $aArgs: Additional arguments
_getLanguageParameter (line 289)

Returns language id or name depending on settings.

  • return: Language id, language name or null
  • access: private
mixed _getLanguageParameter ( $aArgs)
  • array $aArgs: Additional arguments
_getPath (line 310)

Returns composed path of url (normally the category structure)

  • return: Path
  • access: private
string _getPath ( $aPretty)
  • array $aPretty: Pretty url array

Documentation generated on Sun, 08 Feb 2009 22:00:50 +0100 by phpDocumentor 1.4.1