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.

(no description)

File Size: 163 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

report_demo:: (4 methods):
  get_report()
  strnpos()
  parse_url()
  complete_urls()


Class: report_demo  - X-Ref

Returns the entire document marked-up to highlight problems.

get_report()   X-Ref
The get_report method - we iterate through every test item and
add additional attributes to build the report UI.

return: string A fully-formed HTML document.

strnpos($haystack, $needle, $occurance, int $pos = 0)   X-Ref
Finds the final postion of a needle in the haystack.

param: mixed $haystack
param: mixed $needle
param: mixed $occurance
param: int $pos
return: false|int

parse_url(string $url)   X-Ref
A helper function for completeURLs. Parses a URL into an the scheme, host, and path

param: string $url The URL to parse
return: array An array that includes the scheme, host, and path of the URL

complete_urls(string $html, string $url)   X-Ref
Turns all relative links to absolute links so that the page can be rendered correctly.

param: string $html A complete HTML document
param: string $url The absolute URL to the document
return: string A HTML document with all the relative links converted to absolute links