PHP Class RainLab\Translate\Behaviors\TranslatablePageUrl

Usage: In the model class definition: public $implement = ['@RainLab.Translate.Behaviors.TranslatablePageUrl'];
Inheritance: extends October\Rain\Extension\ExtensionBase
Mostra file Open project: rainlab/translate-plugin

Protected Properties

Property Type Description
$model Reference to the extended model.
$translatableContext Active language for translations.
$translatableDefault Default system language.
$translatableDefaultUrl Default page URL.

Public Methods

Method Description
__construct ( October\Rain\Database\Model $model ) Constructor
getSettingsUrlAttributeTranslated ( $locale ) : string Mutator detected by MLControl
getViewBagUrlAttributeTranslated ( $locale ) : string Mutator detected by MLControl, proxy for Static Pages plugin.
hasTranslatablePageUrl ( $locale = null ) : boolean Determines if a locale has a translated URL.
initTranslatableContext ( ) : void Initializes this class, sets the default language code to use.
rewriteTranslatablePageUrl ( $locale = null ) : void Checks if a translated URL exists and rewrites it, this method should only be called from the context of front-end.
setSettingsUrlAttributeTranslated ( $value, $locale ) : void Mutator detected by MLControl
setViewBagUrlAttributeTranslated ( $value, $locale ) : void Mutator detected by MLControl, proxy for Static Pages plugin.

Protected Methods

Method Description
getModelUrl ( )
setModelUrl ( $value )

Method Details

__construct() public method

Constructor
public __construct ( October\Rain\Database\Model $model )
$model October\Rain\Database\Model The extended model.

getModelUrl() protected method

protected getModelUrl ( )

getSettingsUrlAttributeTranslated() public method

Mutator detected by MLControl
public getSettingsUrlAttributeTranslated ( $locale ) : string
return string

getViewBagUrlAttributeTranslated() public method

Mutator detected by MLControl, proxy for Static Pages plugin.
public getViewBagUrlAttributeTranslated ( $locale ) : string
return string

hasTranslatablePageUrl() public method

Determines if a locale has a translated URL.
public hasTranslatablePageUrl ( $locale = null ) : boolean
return boolean

initTranslatableContext() public method

Initializes this class, sets the default language code to use.
public initTranslatableContext ( ) : void
return void

rewriteTranslatablePageUrl() public method

Checks if a translated URL exists and rewrites it, this method should only be called from the context of front-end.
public rewriteTranslatablePageUrl ( $locale = null ) : void
return void

setModelUrl() protected method

protected setModelUrl ( $value )

setSettingsUrlAttributeTranslated() public method

Mutator detected by MLControl
public setSettingsUrlAttributeTranslated ( $value, $locale ) : void
return void

setViewBagUrlAttributeTranslated() public method

Mutator detected by MLControl, proxy for Static Pages plugin.
public setViewBagUrlAttributeTranslated ( $value, $locale ) : void
return void

Property Details

$model protected_oe property

Reference to the extended model.
protected $model

$translatableContext protected_oe property

Active language for translations.
protected $translatableContext

$translatableDefault protected_oe property

Default system language.
protected $translatableDefault

$translatableDefaultUrl protected_oe property

Default page URL.
protected $translatableDefaultUrl