Elgg
Version master
|
Go to the source code of this file.
Functions | |
elgg_define_js (string $name, array $config) | |
Helper functions for external files like css/js. More... | |
elgg_require_js (string $name) | |
Request that Elgg load an AMD module onto the page. More... | |
elgg_unrequire_js (string $name) | |
Cancel a request to load an AMD module onto the page. More... | |
elgg_require_css (string $view) | |
Register a CSS view name to be included in the HTML head. More... | |
elgg_unrequire_css (string $view) | |
Unregister a CSS view name to be included in the HTML head. More... | |
elgg_register_external_file (string $type, string $name, string $url, string $location= '') | |
Core registration function for external files. More... | |
elgg_unregister_external_file (string $type, string $name) | |
Unregister an external file. More... | |
elgg_load_external_file (string $type, string $name) | |
Load an external resource for use on this page. More... | |
elgg_get_loaded_external_resources (string $type, string $location) | |
Get external resource descriptors. More... | |
elgg_define_js | ( | string | $name, |
array | $config | ||
) |
Helper functions for external files like css/js.
Defines a JS lib as an AMD module. This is useful for shimming traditional JS or for setting the paths of AMD modules.
Calling multiple times for the same name will:
Use elgg_require_js($name) to load on the current page.
Calling this function is not needed if your JS are in views named like module/name.js
Instead, simply call elgg_require_js("module/name").
string | $name | The module name |
array | $config | An array like the following: array 'deps' An array of AMD module dependencies string 'exports' The name of the exported module string 'src' The URL to the JS. Can be relative. |
Definition at line 30 of file external_files.php.
elgg_get_loaded_external_resources | ( | string | $type, |
string | $location | ||
) |
Get external resource descriptors.
string | $type | Type of file: js or css |
string | $location | Page location |
Definition at line 152 of file external_files.php.
elgg_load_external_file | ( | string | $type, |
string | $name | ||
) |
Load an external resource for use on this page.
string | $type | Type of file: js or css |
string | $name | The identifier for the file |
Definition at line 139 of file external_files.php.
elgg_register_external_file | ( | string | $type, |
string | $name, | ||
string | $url, | ||
string | $location = '' |
||
) |
Core registration function for external files.
string | $type | Type of external resource (js or css) |
string | $name | Identifier used as key |
string | $url | URL |
string | $location | Location in the page to include the file (default = 'footer' for js, 'head' for anything else) |
Definition at line 109 of file external_files.php.
elgg_require_css | ( | string | $view | ) |
Register a CSS view name to be included in the HTML head.
string | $view | The css view name |
Definition at line 76 of file external_files.php.
elgg_require_js | ( | string | $name | ) |
Request that Elgg load an AMD module onto the page.
string | $name | The AMD module name |
Definition at line 52 of file external_files.php.
elgg_unregister_external_file | ( | string | $type, |
string | $name | ||
) |
Unregister an external file.
string | $type | Type of file: js or css |
string | $name | The identifier of the file |
Definition at line 126 of file external_files.php.
elgg_unrequire_css | ( | string | $view | ) |
Unregister a CSS view name to be included in the HTML head.
string | $view | The css view name |
Definition at line 94 of file external_files.php.
elgg_unrequire_js | ( | string | $name | ) |
Cancel a request to load an AMD module onto the page.
string | $name | The AMD module name |
Definition at line 64 of file external_files.php.