Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Library functions to facilitate the use of JavaScript in Moodle.

Copyright: 2016 Adrian Greeve <adrian@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 129 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

fragment_requirements_manager:: (3 methods):
  __construct()
  get_amd_footercode()
  get_end_code()


Class: fragment_requirements_manager  - X-Ref

This requirements manager captures the appropriate html for creating a fragment to
be inserted elsewhere.

__construct()   X-Ref
Page fragment constructor.


get_amd_footercode()   X-Ref
Returns js code to load amd module loader, then insert inline script tags
that contain require() calls using RequireJS.

return: string

get_end_code()   X-Ref
Generate any HTML that needs to go at the end of the page.

return: string the HTML code to to at the end of the page.