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.

Differences Between: [Versions 401 and 402] [Versions 401 and 403]

(no description)

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

Defines 1 class

primary:: (5 methods):
  __construct()
  export_for_template()
  get_primary_nav()
  get_custom_menu()
  get_user_menu()


Class: primary  - X-Ref

Primary navigation renderable

This file combines primary nav, custom menu, lang menu and
usermenu into a standardized format for the frontend

__construct($page)   X-Ref
primary constructor.

param: \moodle_page $page

export_for_template(?renderer_base $output = null)   X-Ref
Combine the various menus into a standardized output.

param: renderer_base|null $output
return: array

get_primary_nav()   X-Ref
Get the primary nav object and standardize the output

return: array

get_custom_menu(renderer_base $output)   X-Ref
Custom menu items reside on the same level as the original nodes.
Fetch and convert the nodes to a standardised array.

param: renderer_base $output
return: array

get_user_menu(renderer_base $output)   X-Ref
Get/Generate the user menu.

This is leveraging the data from user_get_user_navigation_info and the logic in $OUTPUT->user_menu()

param: renderer_base $output
return: array