JavaScriptModuleInstruction

class \TYPO3\CMS\Core\Page\JavaScriptModuleInstruction

Implements
JsonSerializable

Table of Contents

Interfaces

JsonSerializable

Constants

FLAG_LOAD_IMPORTMAP  : mixed = 2
Indicates an ES6/11 module shall be loaded (paths mapped by an importmap)
FLAG_LOAD_REQUIRE_JS  : mixed = 1
Indicates a requireJS module shall be loaded.
FLAG_USE_TOP_WINDOW  : mixed = 16
Indicates all actions shall be applied globally to `top.window`.
ITEM_ASSIGN  : mixed = 'assign'
ITEM_INSTANCE  : mixed = 'instance'
ITEM_INVOKE  : mixed = 'invoke'

Properties

$exportName  : string|null
$flags  : int
$items  : array
$name  : string

Methods

__construct()  : mixed
addFlags()  : $this
assign()  : static
create()  : self
forRequireJS()  : self
fromState()  : self
getExportName()  : string|null
getFlags()  : int
getItems()  : array
getName()  : string
getState()  : array
instance()  : static
invoke()  : static
jsonSerialize()  : array
shallLoadImportMap()  : bool
shallLoadRequireJs()  : bool
shallUseTopWindow()  : bool

Constants

FLAG_LOAD_IMPORTMAP

Indicates an ES6/11 module shall be loaded (paths mapped by an importmap)

public mixed FLAG_LOAD_IMPORTMAP = 2

FLAG_LOAD_REQUIRE_JS

Indicates a requireJS module shall be loaded.

Deprecated

will be removed in TYPO3 v13.0

public mixed FLAG_LOAD_REQUIRE_JS = 1

FLAG_USE_TOP_WINDOW

Indicates all actions shall be applied globally to `top.window`.

public mixed FLAG_USE_TOP_WINDOW = 16

ITEM_ASSIGN

public mixed ITEM_ASSIGN = 'assign'

ITEM_INSTANCE

public mixed ITEM_INSTANCE = 'instance'

ITEM_INVOKE

public mixed ITEM_INVOKE = 'invoke'

Properties

$exportName

protected string|null $exportName

Methods

__construct()

public __construct(string $name, int $flags) : mixed

Parameters

$name : string

Module name

$flags : int

addFlags()

public addFlags(int ...$flags) : $this

Parameters

$flags : int

Return values

$this

assign()

public assign(array $assignments) : static

Parameters

$assignments : array

key-value assignments

Return values

static

create()

public static create(string $name[, string|null $exportName = null ]) : self

Parameters

$name : string

Module name mapped by an importmap or absolute specifier

$exportName : string|null = null

(optional) name used internally to export the module

Return values

self

forRequireJS()

public static forRequireJS(string $name[, string|null $exportName = null ][, bool $internalCall = false ]) : self

Deprecated

will be removed in TYPO3 v13.0. Use JavaScriptModuleInstruction::create() instead.

Parameters

$name : string

RequireJS module name

$exportName : string|null = null

(optional) name used internally to export the module

$internalCall : bool = false

Return values

self

fromState()

public static fromState(array $state) : self

Parameters

$state : array

Return values

self

getExportName()

public getExportName() : string|null

Return values

string|null

getFlags()

public getFlags() : int

Return values

int

getItems()

public getItems() : array

Return values

array

getName()

public getName() : string

Return values

string

getState()

public getState() : array

Return values

array

instance()

public instance(mixed ...$args) : static

Parameters

$args : mixed

new instance arguments

Return values

static

invoke()

public invoke([string|null $method = null ], mixed ...$args) : static

Parameters

$method : string|null = null

method of JavaScript module to be invoked

$args : mixed

corresponding method arguments

Return values

static

jsonSerialize()

public jsonSerialize() : array

Return values

array

shallLoadImportMap()

public shallLoadImportMap() : bool

Return values

bool

shallLoadRequireJs()

public shallLoadRequireJs() : bool

Deprecated

will be removed in TYPO3 v13.0

Return values

bool

shallUseTopWindow()

public shallUseTopWindow() : bool

Return values

bool
On this page