JavaScriptRenderer
Table of Contents
Properties
- $handlerUri : string
- $importMap : ImportMap
- $items : JavaScriptItems
- $javaScriptModuleInstructionFlags : int
Methods
- __construct() : mixed
- addGlobalAssignment() : void
- addJavaScriptModuleInstruction() : void
- create() : self
- getState() : array<string|int, mixed>
- hasImportMap() : bool
- includeAllImports() : void
- HEADS UP: Do only use in authenticated mode as this discloses as installed extensions
- includeTaggedImports() : void
- render() : string
- renderImportMap() : string
- toArray() : array<int, array{type: string, payload: mixed}>
- updateState() : void
- createScriptElement() : string
- isEmpty() : bool
- jsonEncode() : string
Properties
$handlerUri
protected
string
$handlerUri
$importMap
protected
ImportMap
$importMap
$items
protected
JavaScriptItems
$items
$javaScriptModuleInstructionFlags
protected
int
$javaScriptModuleInstructionFlags
= 0
Methods
__construct()
public
__construct(string $handlerUri) : mixed
Parameters
- $handlerUri : string
addGlobalAssignment()
public
addGlobalAssignment(array<string|int, mixed> $payload) : void
Parameters
- $payload : array<string|int, mixed>
addJavaScriptModuleInstruction()
public
addJavaScriptModuleInstruction(JavaScriptModuleInstruction $instruction) : void
Parameters
- $instruction : JavaScriptModuleInstruction
create()
public
static create([string|null $uri = null ]) : self
Parameters
- $uri : string|null = null
Return values
selfgetState()
public
getState() : array<string|int, mixed>
Return values
array<string|int, mixed>hasImportMap()
public
hasImportMap() : bool
Return values
boolincludeAllImports()
HEADS UP: Do only use in authenticated mode as this discloses as installed extensions
public
includeAllImports() : void
includeTaggedImports()
public
includeTaggedImports(string $tag) : void
Parameters
- $tag : string
render()
public
render([null|string|ConsumableNonce $nonce = null ]) : string
Parameters
- $nonce : null|string|ConsumableNonce = null
Return values
stringrenderImportMap()
public
renderImportMap(string $sitePath[, null|string|ConsumableNonce $nonce = null ]) : string
Parameters
- $sitePath : string
- $nonce : null|string|ConsumableNonce = null
Return values
stringtoArray()
public
toArray() : array<int, array{type: string, payload: mixed}>
Return values
array<int, array{type: string, payload: mixed}>updateState()
public
updateState(array<string|int, mixed> $state) : void
Parameters
- $state : array<string|int, mixed>
createScriptElement()
protected
createScriptElement(array<string|int, mixed> $attributes[, string $textContent = '' ]) : string
Parameters
- $attributes : array<string|int, mixed>
- $textContent : string = ''
Return values
stringisEmpty()
protected
isEmpty() : bool
Return values
booljsonEncode()
protected
jsonEncode(mixed $value) : string
Parameters
- $value : mixed