Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.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.