JSEngineConfiguration
in package
Class JSEngineConfiguration
Tags
Table of Contents
- $baseUrl : string
- $bustFiles : bool
- $cacheToken : string
- $config : array<string|int, mixed>
- $environment : string
- $languageCode : string
- $languageTextManager : LanguageTextManager
- $pageToken : string
- $sections : array<string|int, mixed>
- $templatePath : string
- __construct() : mixed
- asJson() : string
- Get JSEngine configuration as an JSON encoded string
- getJavaScript() : string
- _getSections() : array<string|int, mixed>
- Helper method for adding additional language sections.
- _getTranslations() : string
- Get translations array.
- _init() : mixed
- Initialize JSEngine configuration.
Properties
$baseUrl
protected
string
$baseUrl
$bustFiles
protected
bool
$bustFiles
= alse
$cacheToken
protected
string
$cacheToken
= ''
$config
protected
array<string|int, mixed>
$config
$environment
protected
string
$environment
$languageCode
protected
string
$languageCode
$languageTextManager
protected
LanguageTextManager
$languageTextManager
$pageToken
protected
string
$pageToken
= ''
$sections
protected
array<string|int, mixed>
$sections
$templatePath
protected
string
$templatePath
Methods
__construct()
public
__construct(NonEmptyStringType $baseUrl, NonEmptyStringType $templatePath, LanguageCode $languageCode, LanguageTextManager $languageTextManager, EditableKeyValueCollection $sections, BoolType $debugMode[, StringType $pageToken = null ][, StringType $cacheToken = null ]) : mixed
Parameters
- $baseUrl : NonEmptyStringType
- $templatePath : NonEmptyStringType
- $languageCode : LanguageCode
- $languageTextManager : LanguageTextManager
- $sections : EditableKeyValueCollection
- $debugMode : BoolType
- $pageToken : StringType = null
- $cacheToken : StringType = null
Return values
mixed —asJson()
Get JSEngine configuration as an JSON encoded string
public
asJson() : string
Return values
string —getJavaScript()
public
getJavaScript() : string
Return values
string —_getSections()
Helper method for adding additional language sections.
protected
_getSections() : array<string|int, mixed>
Overload example for adding the section "section_name":
protected function _getSections() { $additionalSection = array('js_section_name' => 'section_name'); $this->sections = array_merge($this->sections, $additionalSection);
return parent::_getSections();
}
Use in JS: jse.core.lang.translate('phrase_name', 'js_section_name') // phrase value will be returned;
Visit https://developers.gambio.de for more information.
Return values
array<string|int, mixed> —_getTranslations()
Get translations array.
protected
_getTranslations() : string
Return values
string —_init()
Initialize JSEngine configuration.
protected
_init() : mixed