Skip to content
Snippets Groups Projects
Commit 5144743a authored by Angie Byron's avatar Angie Byron
Browse files

#930566 by Benjamin Melançon: Clarify hook_help() documentation for dealing with wildcards.

parent d63aef07
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -14,30 +14,30 @@
/**
* Provide online user help.
*
* By implementing hook_help(), a module can make documentation
* available to the user for the module as a whole, or for specific paths.
* Help for developers should usually be provided via function
* header comments in the code, or in special API example files.
* By implementing hook_help(), a module can make documentation available to
* the user for the module as a whole, or for specific paths. Help for
* developers should usually be provided via function header comments in the
* code, or in special API example files.
*
* For a detailed usage example, see page_example.module.
*
* @param $path
* The router menu path, as defined in hook_menu(), for the help that
* is being requested; e.g., 'admin/node' or 'user/edit'. If the router path
* includes a % wildcard, then this will appear in $path; for example,
* node pages would have $path equal to 'node/%' or 'node/%/view'. Your hook
* implementation may also be called with special descriptors after a
* "#" sign. Some examples:
* - admin/help#modulename
* The main module help text, displayed on the admin/help/modulename
* page and linked to from the admin/help page.
* - user/help#modulename
* The help for a distributed authorization module (if applicable).
* The router menu path, as defined in hook_menu(), for the help that is
* being requested; e.g., 'admin/people' or 'user/register'. If the router
* path includes a wildcard, then this will appear in $path as %, even if it
* is a named %autoloader wildcard in the hook_menu() implementation; for
* example, node pages would have $path equal to 'node/%' or 'node/%/view'.
* To provide a help page for a whole module with a listing on admin/help,
* your hook implementation should match a path with a special descriptor
* after a "#" sign:
* 'admin/help#modulename'
* The main module help text, displayed on the admin/help/modulename
* page and linked to from the admin/help page.
* @param $arg
* An array that corresponds to the return value of the arg() function, for
* modules that want to provide help that is specific to certain values
* of wildcards in $path. For example, you could provide help for the path
* 'user/1' by looking for the path 'user/%' and $arg[1] == '1'. This
* 'user/1' by looking for the path 'user/%' and $arg[1] == '1'. This given
* array should always be used rather than directly invoking arg(), because
* your hook implementation may be called for other purposes besides building
* the current page's help. Note that depending on which module is invoking
......
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