|
ILIAS
trunk Revision v13.0_alpha-62-g3b72d83f2e5
|
Wraps global ilTemplate to provide JavaScriptBinding. More...
Inheritance diagram for ILIAS\UI\Implementation\Render\ilJavaScriptBinding:
Collaboration diagram for ILIAS\UI\Implementation\Render\ilJavaScriptBinding:Public Member Functions | |
| __construct (private \ILIAS\UICore\GlobalTemplate $global_tpl,) | |
| createId () | |
| Create a fresh unique id.This MUST return a new id on every call. More... | |
| addOnLoadCode (string $code) | |
| Add some JavaScript-statements to the on-load handler of the page. More... | |
| getOnLoadCodeAsync () | |
| Get all the registered on-load javascript code for the async context, e.g.return all code inside <script> tags More... | |
| clearOnLoadCodeAsync () | |
| Clears all JavaScript code currently registered for the async context. More... | |
| createId () | |
| Create a fresh unique id. More... | |
| addOnLoadCode (string $code) | |
| Add some JavaScript-statements to the on-load handler of the page. More... | |
| getOnLoadCodeAsync () | |
| Get all the registered on-load javascript code for the async context, e.g. More... | |
| clearOnLoadCodeAsync () | |
| Clears all JavaScript code currently registered for the async context. More... | |
Data Fields | |
| const | PREFIX = "il_ui_fw_" |
Protected Attributes | |
| array | $code = array() |
| Cache for all registered JS code. More... | |
Wraps global ilTemplate to provide JavaScriptBinding.
Definition at line 26 of file ilJavaScriptBinding.php.
| ILIAS\UI\Implementation\Render\ilJavaScriptBinding::__construct | ( | private \ILIAS\UICore\GlobalTemplate | $global_tpl | ) |
Definition at line 35 of file ilJavaScriptBinding.php.
| ILIAS\UI\Implementation\Render\ilJavaScriptBinding::addOnLoadCode | ( | string | $code | ) |
Add some JavaScript-statements to the on-load handler of the page.
Implements ILIAS\UI\Implementation\Render\JavaScriptBinding.
Definition at line 51 of file ilJavaScriptBinding.php.
References ILIAS\UI\Implementation\Render\ilJavaScriptBinding\$code.
| ILIAS\UI\Implementation\Render\ilJavaScriptBinding::clearOnLoadCodeAsync | ( | ) |
Clears all JavaScript code currently registered for the async context.
This is necessary because rendering can register JavaScript as a side effect, even when the rendered output is not required by the current async endpoint.
This is caused by ILIAS treating controllers as independent layers, meaning a controller cannot reliably determine what has been executed before it, while each layer may contribute parts of the page. This causes unnecessary rendering and JavaScript registration. This method prevents said JavaScript from leaking into the async response.
This is a reminder that we want proper routing inside ILIAS: https://docu.ilias.de/go/wiki/wpage_8780_1357
Implements ILIAS\UI\Implementation\Render\JavaScriptBinding.
Definition at line 69 of file ilJavaScriptBinding.php.
| ILIAS\UI\Implementation\Render\ilJavaScriptBinding::createId | ( | ) |
Create a fresh unique id.This MUST return a new id on every call.
Implements ILIAS\UI\Implementation\Render\JavaScriptBinding.
Definition at line 43 of file ilJavaScriptBinding.php.
| ILIAS\UI\Implementation\Render\ilJavaScriptBinding::getOnLoadCodeAsync | ( | ) |
Get all the registered on-load javascript code for the async context, e.g.return all code inside <script> tags
Implements ILIAS\UI\Implementation\Render\JavaScriptBinding.
Definition at line 60 of file ilJavaScriptBinding.php.
|
protected |
Cache for all registered JS code.
Definition at line 33 of file ilJavaScriptBinding.php.
Referenced by ILIAS\UI\Implementation\Render\ilJavaScriptBinding\addOnLoadCode().
| const ILIAS\UI\Implementation\Render\ilJavaScriptBinding::PREFIX = "il_ui_fw_" |
Definition at line 28 of file ilJavaScriptBinding.php.