Demonstrates uses of the Menu APIs in Backdrop.

The Page Example module also talks about the menu system, as well as how to use menu arguments to generate pages.

See also

hook_menu()

hook_menu_alter()

hook_menu_link_alter()

Example: Page

page_example_menu()

Parent topics

File

modules/examples/menu_example/menu_example.module, line 8
Module file for menu_example.

Functions

Name Locationsort descending Description
menu_example_menu modules/examples/menu_example/menu_example.module Implements hook_menu().
_menu_example_basic_instructions modules/examples/menu_example/menu_example.module Page callback for the simplest introduction menu entry.
_menu_example_menu_page modules/examples/menu_example/menu_example.module Page callback for use with most of the menu entries.
menu_example_permission modules/examples/menu_example/menu_example.module Implements hook_permission().
menu_example_custom_access modules/examples/menu_example/menu_example.module Determine whether the current user has the role specified.
_menu_example_mappings modules/examples/menu_example/menu_example.module Utility function to provide mappings from integers to some strings.
menu_example_id_load modules/examples/menu_example/menu_example.module The special _load function to load menu_example.
menu_example_menu_alter modules/examples/menu_example/menu_example.module Implements hook_menu_alter().
_menu_example_simple_title_callback modules/examples/menu_example/menu_example.module Title callback to rewrite the '/user' menu link.
menu_example_user_page_title modules/examples/menu_example/menu_example.module Title callback to rename the title dynamically, based on user_page_title().
menu_example_menu_link_alter modules/examples/menu_example/menu_example.module Implements hook_menu_link_alter().
menu_example_arg_optional_load modules/examples/menu_example/menu_example.module Loads an item based on its $id.
menu_example_arg_optional_to_arg modules/examples/menu_example/menu_example.module Utility function to provide default argument for wildcard.

Classes

Name Locationsort descending Description
MenuExampleTestCase modules/examples/menu_example/menu_example.test Functional tests for the Menu Example module.