function drupalgap_help in DrupalGap 8
Same name and namespace in other branches
- 7.2 drupalgap.module \drupalgap_help()
- 7 drupalgap.module \drupalgap_help()
- 8.0.x drupalgap.module \drupalgap_help()
Implements hook_help().
File
- ./
drupalgap.module, line 9
Code
function drupalgap_help($route_name, \Drupal\Core\Routing\RouteMatchInterface $route_match) {
if ($route_name == 'help.page.drupalgap') {
// Module README link.
$moduleReadmePath = drupal_get_path('module', 'drupalgap') . '/README.md';
$moduleReadmeLink = Link::fromTextAndUrl(t('Drupal Module README'), Url::fromUri('base:' . $moduleReadmePath))
->toString();
// JS Library README link.
$jsReadmeLink = Link::fromTextAndUrl(t('SDK README'), Url::fromUri('https://github.com/signalpoint/drupalgap/blob/8.x-1.x/README.md'))
->toString();
// Drupal 8 REST config link.
$restConfigLink = Link::fromTextAndUrl(t('Configure Drupal 8 REST'), Url::fromRoute('restui.list'))
->toString();
// Hello world.
$helloWorld = Link::fromTextAndUrl(t('Hello World'), Url::fromUri('http://docs.drupalgap.org/8/Hello_World'))
->toString();
// Troubleshoot.
$troubleshoot = Link::fromTextAndUrl(t('Troubleshoot'), Url::fromUri('http://docs.drupalgap.org/8/Resources/Troubleshoot'))
->toString();
// Project docs.
$projectDocs = Link::fromTextAndUrl(t('Docs'), Url::fromUri('http://docs.drupalgap.org/8'))
->toString();
// Project api.
$projectAPI = Link::fromTextAndUrl(t('API'), Url::fromUri('http://api.drupalgap.org/8'))
->toString();
// Return the help text.
// @TODO convert to render element once Drupal 8 supports it in hook_help().
$msg = t('Use DrupalGap to build applications powered by Drupal.');
$help = "<p>{$msg}</p>";
$help .= "<ul>";
$help .= "<li>{$moduleReadmeLink}</li>";
$help .= "<li>{$jsReadmeLink}</li>";
$help .= "<li>{$restConfigLink}</li>";
$help .= "<li>{$helloWorld}</li>";
$help .= "<li>{$troubleshoot}</li>";
$help .= "<li>{$projectDocs}</li>";
$help .= "<li>{$projectAPI}</li>";
$help .= "</ul>";
return $help;
}
}