First, I'll create a test module to have somewhere to show it:
drush generate module
I call it the tester helper
Open the .module
file and use the following template:
<?php
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function tester_helper_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.tester_helper':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The module is example:') . '</p';
$output .= '<ul>';
$output .= '<li>' . t('To show simple hook template') . '</li>';
$output .= '<li>' . t('To show how the page looks like') . '</li>';
$output .= '<li>' . t('To show it is very easy to create help page for module') . '</li>';
$output .= '</ul>';
return $output;
default:
}
}
Change tester_helper
to the machine name of your module.
In the variable $output
write the contents of the page help.
This is what this page looks like for me:
Latest comments (0)