Mod Rewrite url utility class.

Handles convertion of Urls from CONTENIDO core based url composition pattern to AMR (Advanced Mod Rewrite) url composition pattern and vice versa.

author Murat Purc
package plugin
subpackage Mod Rewrite

 Methods

Returns configuration of mod rewrite, content of gobal $cfg['mod_rewrite']

getConfig(string $key, mixed $default) : mixed
InheritedStatic
inherited_from \ModRewriteBase::getConfig()

Parameters

$key

string

Name of configuration key

$default

mixed

Default value to return as a fallback

Returns

mixedDesired value mr configuration, either the full configuration or one of the desired subpart

Returns self instance (singleton pattern)

getInstance() : \ModRewriteUrlUtil
Static

Returns enabled state of mod rewrite plugin

isEnabled() : bool
InheritedStatic
inherited_from \ModRewriteBase::isEnabled()

Returns

bool

Sets the configuration of mod rewrite, content of gobal $cfg['mod_rewrite']

setConfig(string $key, mixed $value) 
InheritedStatic
inherited_from \ModRewriteBase::setConfig()

Parameters

$key

string

Name of configuration key

$value

mixed

The value to set

Sets the enabled state of mod rewrite plugin

setEnabled(bool $bEnabled) 
InheritedStatic
inherited_from \ModRewriteBase::setEnabled()

Parameters

$bEnabled

bool

Converts passed AMR url to CONTENIDO url.

toContenidoUrl(string $url) : string

Parameters

$url

string

AMR url

Returns

stringCONTENIDO url

Converts passed AMR url name to CONTENIDO url name.

toContenidoUrlName(string $urlName) : string

Parameters

$urlName

string

AMR url name

Returns

stringCONTENIDO url name

Converts passed AMR url path to CONTENIDO url path.

toContenidoUrlPath(string $urlPath) : string

Parameters

$urlPath

string

AMR url path

Returns

stringCONTENIDO url path

Converts passed AMR url to CONTENIDO url.

toModRewriteUrl(string $url) : string

Parameters

$url

string

AMR url

Returns

stringCONTENIDO url

Converts passed CONTENIDO url name to AMR url name.

toModRewriteUrlName(string $urlName) : string

Parameters

$urlName

string

CONTENIDO url name

Returns

stringAMR url name

Converts passed CONTENIDO url path to AMR url path.

toModRewriteUrlPath(string $urlPath) : string

Parameters

$urlPath

string

CONTENIDO url path

Returns

stringAMR url path

Prevent cloning

__clone() 

Constructor, sets some AMR configuration related properties

__construct() 

Converts passed url to a another url (CONTENIDO to AMR and vice versa).

_toUrl(string $url, string $fromCatSep, string $toCatSep, string $fromCatWordSep, string $toCatWordSep, string $fromArtSep, string $toArtSep, string $fromArtWordSep, string $toArtWordSep) : string
deprecated No more used, is to delete

Parameters

$url

string

Source url

$fromCatSep

string

Source category seperator

$toCatSep

string

Destination category seperator

$fromCatWordSep

string

Source category word seperator

$toCatWordSep

string

Destination category word seperator

$fromArtSep

string

Source article seperator

$toArtSep

string

Destination article seperator

$fromArtWordSep

string

Source article word seperator

$toArtWordSep

string

Destination article word seperator

Returns

stringDestination url

Converts passed url name to a another url name (CONTENIDO to AMR and vice versa).

_toUrlName(string $urlName, string $fromArtWordSep, string $toArtWordSep) : string

Parameters

$urlName

string

Source url name

$fromArtWordSep

string

Source article word seperator

$toArtWordSep

string

Destination article word seperator

Returns

stringDestination url name

Converts passed url path to a another url path (CONTENIDO to AMR and vice versa).

_toUrlPath(string $urlPath, string $fromCatSep, string $toCatSep, string $fromCatWordSep, string $toCatWordSep, string $fromArtSep, string $toArtSep) : string

Parameters

$urlPath

string

Source url path

$fromCatSep

string

Source category seperator

$toCatSep

string

Destination category seperator

$fromCatWordSep

string

Source category word seperator

$toCatWordSep

string

Destination category word seperator

$fromArtSep

string

Source article seperator

$toArtSep

string

Destination article seperator

Returns

stringDestination url path

 Properties

 

$_artSep : string
 

$_artWordSep : string
 

$_catSep : string
 

$_catWordSep : string
 

$_instance : \ModRewriteUrlUtil
 

$_mrArtSep : string
 

$_mrArtWordSep : string
 

$_mrCatSep : string
 

$_mrCatWordSep : string
 

$_mrExt : string

g. .html)