JavaScriptRenderer
class \
Table of Contents
Properties
- $handlerUri : string
- $items : JavaScriptItems
- $requireJS : RequireJS|null
Methods
- __construct() : mixed
- addGlobalAssignment() : void
- addJavaScriptModuleInstruction() : void
- create() : self
- loadRequireJS() : void
- render() : string
- toArray() : array<int, array{type: string, payload: mixed}>
- createScriptElement() : string
- isEmpty() : bool
- jsonEncode() : string
Properties
$handlerUri
protected
string
$handlerUri
$items
protected
JavaScriptItems
$items
$requireJS
protected
RequireJS|null
$requireJS
= null
Methods
__construct()
public
__construct(string $handlerUri) : mixed
Parameters
- $handlerUri : string
addGlobalAssignment()
public
addGlobalAssignment(array $payload) : void
Parameters
- $payload : array
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
selfloadRequireJS()
public
loadRequireJS(RequireJS $requireJS) : void
Parameters
- $requireJS : RequireJS
render()
public
render() : string
Return values
stringtoArray()
public
toArray() : array<int, array{type: string, payload: mixed}>
Internal
Return values
array<int, array{type: string, payload: mixed}>createScriptElement()
protected
createScriptElement(array $attributes[, string $textContent = '' ]) : string
Parameters
- $attributes : array
- $textContent : string = ''
Return values
stringisEmpty()
protected
isEmpty() : bool
Return values
booljsonEncode()
protected
jsonEncode(mixed $value) : string
Parameters
- $value : mixed