You are here

function devel_help in Devel 8.2

Same name and namespace in other branches
  1. 8.3 devel.module \devel_help()
  2. 8 devel.module \devel_help()
  3. 5 devel.module \devel_help()
  4. 6 devel.module \devel_help()
  5. 7 devel.module \devel_help()
  6. 4.x devel.module \devel_help()

Implements hook_help().

File

./devel.module, line 33
This module holds functions useful for Drupal development.

Code

function devel_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
    case 'help.page.devel':
      $output = '';
      $output .= '<h3>' . t('About') . '</h3>';
      $output .= '<p>' . t('The Devel module provides a suite of modules containing fun for module developers and themers. For more information, see the <a href=":url">online documentation for the Devel module</a>.', [
        ':url' => 'https://www.drupal.org/docs/8/modules/devel',
      ]) . '</p>';
      $output .= '<h3>' . t('Uses') . '</h3>';
      $output .= '<dl>';
      $output .= '<dt>' . t('Inspecting Service Container') . '</dt>';
      $output .= '<dd>' . t('The module allows you to inspect Services and Parameters registered in the Service Container. You can see those informations on <a href=":url">Container info</a> page.', [
        ':url' => Url::fromRoute('devel.container_info.service')
          ->toString(),
      ]) . '</dd>';
      $output .= '<dt>' . t('Inspecting Routes') . '</dt>';
      $output .= '<dd>' . t('The module allows you to inspect routes information, gathering all routing data from <em>.routing.yml</em> files and from classes which subscribe to the route build/alter events. You can see those informations on <a href=":url">Routes info</a> page.', [
        ':url' => Url::fromRoute('devel.route_info')
          ->toString(),
      ]) . '</dd>';
      $output .= '<dt>' . t('Inspecting Events') . '</dt>';
      $output .= '<dd>' . t('The module allow you to inspect listeners registered in the event dispatcher. You can see those informations on <a href=":url">Events info</a> page.', [
        ':url' => Url::fromRoute('devel.event_info')
          ->toString(),
      ]) . '</dd>';
      $output .= '</dl>';
      return $output;
    case 'devel.container_info.service':
    case 'devel.container_info.parameter':
      $output = '';
      $output .= '<p>' . t('Displays Services and Parameters registered in the Service Container. For more informations on the Service Container, see the <a href=":url">Symfony online documentation</a>.', [
        ':url' => 'http://symfony.com/doc/current/service_container.html',
      ]) . '</p>';
      return $output;
    case 'devel.route_info':
      $output = '';
      $output .= '<p>' . t('Displays registered routes for the site. For a complete overview of the routing system, see the <a href=":url">online documentation</a>.', [
        ':url' => 'https://www.drupal.org/docs/8/api/routing-system',
      ]) . '</p>';
      return $output;
    case 'devel.event_info':
      $output = '';
      $output .= '<p>' . t('Displays events and listeners registered in the event dispatcher. For a complete overview of the event system, see the <a href=":url">Symfony online documentation</a>.', [
        ':url' => 'http://symfony.com/doc/current/components/event_dispatcher.html',
      ]) . '</p>';
      return $output;
    case 'devel.reinstall':
      $output = '<p>' . t('<strong>Warning</strong> - will delete your module tables and configuration.') . '</p>';
      $output .= '<p>' . t('Uninstall and then install the selected modules. <code>hook_uninstall()</code> and <code>hook_install()</code> will be executed and the schema version number will be set to the most recent update number.') . '</p>';
      return $output;
    case 'devel/session':
      return '<p>' . t('Here are the contents of your <code>$_SESSION</code> variable.') . '</p>';
    case 'devel.state_system_page':
      return '<p>' . t('This is a list of state variables and their values. For more information read online documentation of <a href=":documentation">State API in Drupal 8</a>.', [
        ':documentation' => "https://www.drupal.org/developing/api/8/state",
      ]) . '</p>';
    case 'devel.layout_info':
      $output = '';
      $output .= '<p>' . t('Displays layouts available to the site. For a complete overview of the layout system, see the <a href=":url">Layout API documentation</a>.', [
        ':url' => 'https://www.drupal.org/docs/8/api/layout-api',
      ]) . '</p>';
      return $output;
  }
}