Moodle APIs 4.1
Moodle 4.1.9+ (Build: 20240402)
Static Public Member Functions | List of all members
core_requirejs Class Reference

Collection of requirejs related methods. More...

Static Public Member Functions

static find_all_amd_modules ($unused=false, $includelazy=false)
 Scan the source for AMD modules and return them all.
 
static find_one_amd_module ($component, $jsfilename, $unused=false)
 Check a single module exists and return the full path to it.
 

Detailed Description

Collection of requirejs related methods.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ find_all_amd_modules()

static core_requirejs::find_all_amd_modules (   $unused = false,
  $includelazy = false 
)
static

Scan the source for AMD modules and return them all.

The expected location for amd modules is: <componentdir>/amd/src/modulename.js

Parameters
boolean$unused
boolean$includelazyIf true, includes modules with the -lazy suffix.
Return values
array::$filesAn array of mappings from module names to file paths.

◆ find_one_amd_module()

static core_requirejs::find_one_amd_module (   $component,
  $jsfilename,
  $unused = false 
)
static

Check a single module exists and return the full path to it.

The expected location for amd modules is: <componentdir>/amd/src/modulename.js

Parameters
string$componentThe component determines the folder the js file should be in.
string$jsfilenameThe filename for the module (with the js extension).
bool$unused
Return values
array::$filesAn array of mappings from module names to file paths. Empty array if the file does not exist.

The documentation for this class was generated from the following file: