NSWDPC\AsyncLoader\Backend
Synopsis
class Backend
extends Requirements_Backend
{
- // constants
- const LOADER_URL = "https://cdnjs.cloudflare.com/ajax/libs/loadjs/3.6.0/loadjs.min.js";
- const LOADER_SCRIPT = ;
- const LOADER_SCRIPT_PLACEHOLDER = "<!-- asyncloader_script_requirements_placeholder -->";
- // members
- protected string $bundle_name = 'requirements_bundle';
- protected string $bundle_name_css = 'requirements_bundle_css';
- protected $bundle_scripts;
- protected array $bundle_stylesheets = ;
- // methods
- public void bundle()
- public void bundle_css()
- private void bundleDispatch()
- private void asyncLoader()
- private void asyncScriptLoader()
- private void addBundleScripts()
- private void addBundleStylesheets()
- public string includeInHTML()
- private void includeInHTMLViaDOMDocument()
Hierarchy
Extends
- Silverstripe\View\Requirements_Backend
Constants
Name | Value |
---|---|
LOADER_URL | "https://cdnjs.cloudflare.com/ajax/libs/loadjs/3.6.0/loadjs.min.js" |
LOADER_SCRIPT | |
LOADER_SCRIPT_PLACEHOLDER | "<!-- asyncloader_script_requirements_placeholder -->" |
Members
protected
- $bundle_name
- $bundle_name_css
- $bundle_scripts
- $bundle_stylesheets
Methods
private
- addBundleScripts() — Include any specific script bundles that are found
- addBundleStylesheets() — Include any specific stylesheet bundles that are found
- asyncLoader() — Return loadjs itself
- asyncScriptLoader() — Load the scripts requested via Requirements::javascript, in the bundle 'requirements_bundle'
- bundleDispatch() — Returns some plain ol' Javascript that will dispatch an event when the named bundle has loaded IE does not support CustomEvent correctly
- includeInHTMLViaDOMDocument() — Use DOMDocument to insert requirements
public
- bundle() — Stores a JS bundle linked to $bundle_name
- bundle_css() — Stores a CSS bundle linked to $bundle_name
- includeInHTML() — Update the given HTML content with the appropriate include tags for the registered requirements. Needs to receive a valid HTML/XHTML template in the $html parameter, including a head and body tag.