Skip to content
Snippets Groups Projects
Unverified Commit ccab6332 authored by Michael McAndrew's avatar Michael McAndrew Committed by GitHub
Browse files

Reference other nav/menu hooks and the civix implementation

parent b86228cc
No related branches found
No related tags found
No related merge requests found
......@@ -6,8 +6,18 @@ This hook is called after the menus are rebuilt.
## Notes
!!! note "Comparison of Related Hooks"
This is one of three related hooks. The hooks:
- [hook_civicrm_navigationMenu](/hooks/hook_civicrm_navigationMenu.md) manipulates the navigation bar at the top of every screen
- [hook_civicrm_alterMenu](/hooks/hook_civicrm_alterMenu.md) manipulates the list of HTTP routes (using PHP arrays)
- [hook_civicrm_xmlMenu](/hooks/hook_civicrm_xmlMenu.md) manipulates the list of HTTP routes (using XML files)
You can use this hook to add new menu, add children to new menu and get the list of menu items for any parent.
!!! note "Use the Civix implementation"
civix comes with helper functions `_EXTENSION_NAME_civix_insert_navigation_menu` and `_EXTENSION_NAME_civix_navigation_menu` that simplify the process of inserting menu items. Consider using these functions rather than using the examples below or writing your own implementation of this hook.
## Definition
```php
......@@ -44,6 +54,8 @@ hook_civicrm_navigationMenu(&$params)
## Examples
!!! note You probably want to use the civix implmentation rather than these examples (see above).
```php
function _getMenuKeyMax($menuArray) {
$max = array(max(array_keys($menuArray)));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment