You are here

function page_example_help in Examples for Developers 7

Same name and namespace in other branches
  1. 8 page_example/page_example.module \page_example_help()
  2. 6 page_example/page_example.module \page_example_help()
  3. 3.x modules/page_example/page_example.module \page_example_help()

Implements hook_help().

Through hook_help(), a module can make documentation available to the user for the module as a whole or for specific paths. Where the help appears depends on the $path specified.

In the first example below, the help text will appear on the simple page defined in hook_menu below in the region designated for help text.

In the second example, the text will be available through the module page as a link beside the module or on the admin help page (admin/help) in the list of help topics using the name of the module. To specify help in the admin section use the module name in the path as in the second case below.

See also

hook_help()

Related topics

File

page_example/page_example.module, line 37
Module file for page_example_module.

Code

function page_example_help($path, $arg) {
  switch ($path) {
    case 'examples/page_example/simple':

      // Help text for the simple page registered for this path.
      return t('This is help text for the simple page.');
    case 'admin/help#page_example':

      // Help text for the admin section, using the module name in the path.
      return t("This is help text created in the page example's second case.");
  }
}