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.

Provides some common features such as common debugging, globals/configuration access for childs.

author Murat Purc
package Contenido Backend plugins
subpackage ModRewrite

 Methods

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

getConfig(string $key, $default) : mixed
Inherited

inherited_from \ModRewriteBase::getConfig()

Parameters

$key

string

Name of configuration key

$default

Returns

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

Returns self instance (singleton pattern)

getInstance() : \ModRewriteUrlUtil

Returns enabled state of mod rewrite plugin

isEnabled() : bool
Inherited

inherited_from \ModRewriteBase::isEnabled()

Returns

bool

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

setConfig(string $key, mixed $value) 
Inherited

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($bEnabled) 
Inherited

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

Parameters

$bEnabled

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

__clone()

__clone() 

Constructor, sets some AMR configuration related properties

__construct() 

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

_toUrl($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

$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

 

Contenido article separator

$_artSep : string

 

Contenido article word separator

$_artWordSep : string

 

Contenido category separator

$_catSep : string

 

Contenido category word separator

$_catWordSep : string

 

Self instance (singleton implementation)

$_instance : \ModRewriteUrlUtil

 

AMR article separator

$_mrArtSep : string

 

AMR article word separator

$_mrArtWordSep : string

 

AMR category separator

$_mrCatSep : string

 

AMR category word separator

$_mrCatWordSep : string

 

AMR extension used for articlenames (e. g. .html)

$_mrExt : string