PHP Trait RainLab\Translate\Traits\MLControl

Author: Alexey Bobkov, Samuel Georges
Exibir arquivo Open project: rainlab/translate-plugin

Public Properties

Property Type Description
$isAvailable Determines whether translation services are available

Protected Properties

Property Type Description
$defaultLocale Object
$parentViewPath Specifies a path to the views directory.

Public Methods

Method Description
getFallbackType ( ) : string Returns the fallback field type.
getLocaleSaveData ( ) : array Returns an array of translated values for this field
getLocaleSaveValue ( $value ) {@inheritDoc}
getLocaleValue ( string $locale ) : string Returns a translated value for a given locale.
initLocale ( ) : void Initialize control
isLocaleFieldJsonable ( ) : boolean Returns true if widget is a repeater, or the field is specified as jsonable in the model.
loadLocaleAssets ( ) Loads assets specific to ML Controls
makeParentPartial ( string $partial, array $params = [] ) : string Used by child classes to render in context of this view path.
prepareLocaleVars ( ) Prepares the list data
renderFallbackField ( ) {@inheritDoc}

Protected Methods

Method Description
makeRenderFormField ( ) If translation is unavailable, render the original field type (text).

Method Details

getFallbackType() public method

Returns the fallback field type.
public getFallbackType ( ) : string
return string

getLocaleSaveData() public method

Returns an array of translated values for this field
public getLocaleSaveData ( ) : array
return array

getLocaleSaveValue() public method

{@inheritDoc}
public getLocaleSaveValue ( $value )

getLocaleValue() public method

Returns a translated value for a given locale.
public getLocaleValue ( string $locale ) : string
$locale string
return string

initLocale() public method

Initialize control
public initLocale ( ) : void
return void

isLocaleFieldJsonable() public method

Returns true if widget is a repeater, or the field is specified as jsonable in the model.
public isLocaleFieldJsonable ( ) : boolean
return boolean

loadLocaleAssets() public method

Loads assets specific to ML Controls
public loadLocaleAssets ( )

makeParentPartial() public method

Used by child classes to render in context of this view path.
public makeParentPartial ( string $partial, array $params = [] ) : string
$partial string The view to load.
$params array Parameter variables to pass to the view.
return string The view contents.

makeRenderFormField() protected method

If translation is unavailable, render the original field type (text).
protected makeRenderFormField ( )

prepareLocaleVars() public method

Prepares the list data
public prepareLocaleVars ( )

renderFallbackField() public method

{@inheritDoc}
public renderFallbackField ( )

Property Details

$defaultLocale protected_oe property

Object
protected $defaultLocale

$isAvailable public_oe property

Determines whether translation services are available
public $isAvailable

$parentViewPath protected_oe property

Specifies a path to the views directory.
protected $parentViewPath