Search moodle.org's
Developer Documentation

See Release Notes

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

Differences Between: [Versions 310 and 403] [Versions 311 and 403] [Versions 39 and 403] [Versions 400 and 403]

Typical crappy helper class with tiny functions.

Copyright: 2017 David Monllao {@link http://www.davidmonllao.com}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 158 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

helper:: (5 methods):
  class_to_option()
  option_to_class()
  set_navbar()
  reset_page()
  prediction_context_selector()


Class: helper  - X-Ref

Helper class with general purpose tiny functions.

class_to_option($class)   X-Ref
Converts a class full name to a select option key

param: string $class
return: string

option_to_class($option)   X-Ref
option_to_class

param: string $option
return: string

set_navbar(string $title, \moodle_url $url, ?\context $context = null)   X-Ref
Sets an analytics > analytics models > $title breadcrumb.

param: string $title
param: \moodle_url $url
param: \context|null $context Defaults to context_system
return: null

reset_page()   X-Ref
Resets the current page.

Note that this function can only be used by analytics pages that work at the system context.

return: null

prediction_context_selector(array $contexts, \moodle_url $url, \renderer_base $output,?int $selected = null, ?bool $includeall = false, ?bool $shortentext = true)   X-Ref
Convert a list of contexts to an associative array where the value is the context name.

param: array            $contexts
param: \moodle_url      $url
param: \renderer_base   $output
param: int|null         $selected
param: bool             $includeall
param: bool             $shortentext
return: \stdClass